Yes, you can upgrade to the Catalina Beta. Or, you can keep getting work done on Mojave and still enjoy the glory of SwiftUI exploration.
- Install Xcode 11 beta along side your 10.2.x Xcode
- Using the beta, create an iOS playground. (This won’t work with macOS, which attempts to use the native frameworks, which don’t yet support SwiftUI)
- Import both SwiftUI and PlaygroundSupport.
- Set the live view to a
UIHostingController
instance whoserootView
conforms toView
.
Here’s an outline of the basic “Hello World” setup:
From there, you can create pages for each of your SwiftUI experiments, allowing you to build short, targeted applets to expand your exploration and understanding of the new technology.
4 Comments
Awesome!
After spending an afternoon getting Catalina to install on an external drive, this solution might prove easier.
Try using an APFS volume or an HFS+ partition on your internal drive next time, if you’ve the disk space (50GB recommendation, 100GB recommendation for active development usage).
Installing macOS on a separate APFS volume: https://support.apple.com/en-us/HT208891
Partition a physical disk using Disk Utility on Mac: https://support.apple.com/guide/disk-utility/partition-a-physical-disk-dskutl14027/mac
Unfortunately some features are not working in the playground (like VStack(alignment: .leading)). So you will be able to build simple layouts but not overly complex ones.