Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of all SwiftUI View types

Tags:

swiftui

Is there a list of all the SwiftUI View types available somewhere?

like image 330
Ralf Ebert Avatar asked May 17 '20 13:05

Ralf Ebert


People also ask

What are views in SwiftUI?

The SwiftUI framework defines a broad range of primitive views. Text , for example, doesn't return a view. It draws the string it is given to the screen. Those primitive views are the building blocks you can use in the custom views you create to build your application's user interface.

What is SwiftUI list?

When you use SwiftUI's List type, you can display a platform-specific list of views. The elements of the list can be static, like the child views of the stacks you've created so far, or dynamically generated. You can even mix static and dynamically generated views.

Why SwiftUI views are struct?

First, there is an element of performance: structs are simpler and faster than classes. I say an element of performance because lots of people think this is the primary reason SwiftUI uses structs, when really it's just one part of the bigger picture.

How do I customize a list in SwiftUI?

Create the project To begin, create a SwiftUI Xcode project, and create a struct , namely, Data . Let's get back in our ContentView. swift and populate some values into this struct . Now, inside your view, create a List, and use ForEach to add and see all your data in list form.


1 Answers

In Xcode itself there is a list of all SwiftUI Views and modifiers available via the Library (+ button in the upper-right corner):

Xcode Library

See also:

  • SwiftUI documentation - Views and Controls
  • At the end of the documentation page for the View protocol, there is a list of all Conforming Types.
like image 79
Ralf Ebert Avatar answered Sep 29 '22 22:09

Ralf Ebert