SwiftUI-Views

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

Views are the heart and soul of building user interfaces in SwiftUI. To help keep things organized, group views into categories based on their primary jobs. Here’s a sneak peek at some of the most common categories you’ll encounter:

Layout Views

These help you arrange and position other views. Think of them as organizing shelves, helping you neatly place images, text, and buttons exactly where you want them. Examples include:

Control Views

These let the user interact with your app. Controls also need to be large enough for people to accurately click or tap. They empower users to tap to start a level in a game, adjust their music volume, or toggle settings on and off. Examples include:

Text Views

These specialize in displaying text. They display everything from simple welcome messages to detailed instructions or even the high scores in your game. Examples include:

Image & Shape Views

Image and shape views are graphical elements that add a level of visual enhancement for your app. These could be product images for a shopping app, achievements for a game, or a dynamic background pattern you create by layering and aligning various shapes. Examples include:

Container Views

These provide structure and navigation for your app’s interface. They help you create smooth transitions between screens, organize content into tabs for easy browsing, and build sophisticated user flows. Examples include:

See forum comments
Download course materials from Github
Previous: Introduction Next: SwiftUI Color Picker