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

7. Sharing Data Between Structures

Wallace Wang1  
(1)
San Diego, CA, USA
 

When creating a simple iOS app, SwiftUI relies on a single structure to define the user interface. Within this structure, you can define State variables that different user interface items (Sliders, TextFields, Toggles, etc.) can access and modify.

However, more sophisticated apps will likely use multiple structures to define its user interface. When you use multiple structures, you need a way to share State variables between structures, and that requires using more than State variables. In this chapter, ...

Get Pro iPhone Development with SwiftUI: Design and Manage Top Quality Apps 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.