Adding SwiftUI to an existing app
A storyboard is a visual representation of the user interface in UIKit. The
Main.storyboard file is to UIKit as the
ContentView.swift file is to SwiftUI. They both are the default home views created when you start a new project.
The recipe begins with a UIKit project that contains a button.
To prepare for this recipe, perform the following steps:
- Clone or download the GitHub project at https://github.com/PacktPublishing/SwiftUI-Cookbook.
- Open the
StartingPointfolder located at
SwiftUI-Cookbook/Chapter01 - Using the basic SwiftUI Views and Controls/10 - Adding SwiftUI to UIKitand double-click on the
AddSwiftUIToUIKitApp.xcodeprojfile. It opens up the UIKit project in Xcode.
How to do it…
We will add a
NavigationController to the UIKit...