Creating an iOS app in SwiftUI
Before going for multiplatform app development, we will create an iOS app. We will be starting with the app created during our work on the Using mock data for previews recipe in Chapter 4, Viewing while Building with SwiftUI Preview in Xcode 15. The version created for this recipe will be more modular to allow for code reuse across platforms, and the resources will not be stored in the preview section of the app.
The app will display a list of insects, you can tap on any insect in the list to see more details about it. The data regarding the insects will be read from a JSON file and made available to our views using an @Environment
variable.
Getting ready
Let’s create a new iOS app in SwiftUI named Multiplatform
. Make sure to select the iOS App template and not the Multiplatform template for this recipe.
Important Note:
The multiplatform template provided with Xcode creates an iOS app with a multiplatform target that...