© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
W. WangBeginning iPhone Development with SwiftUIhttps://doi.org/10.1007/978-1-4842-7818-5_2

2. Designing User Interfaces with SwiftUI

Wally Wang1  
(1)
San Diego, CA, USA
 
Every app needs a user interface. The basic idea behind SwiftUI is to create a user interface using building blocks known as “views.” A view displays a single item on the user interface such as text, an image, or a button as shown in Figure 2-1.
../images/329781_6_En_2_Chapter/329781_6_En_2_Fig1_HTML.jpg
Figure 2-1

The parts of a SwiftUI user interface

One limitation of SwiftUI is that it can only display a single view on the screen at a time. To get around ...

Get Beginning iPhone Development with SwiftUI: Exploring the iOS SDK now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.