In my opinion SwiftUI preview is the most useful feature in SwiftUI if you want to work with older version of IOS. In this post I share how I set up my project.
Create project like showing in the pictures:
Delete the unused ContentView which use the SwiftUI.
Modify AppDelegate as follow.
Build the project and refresh Canvas. The previews should show now. You can try to change a background color of the ViewController and see the change take effect immediately. Like in the video:
Finally, Link to the code.
- ninjahoahong
Comments
Post a Comment