Since Swift Playground 4.6, as you have observed, it is no longer possible to import PlaygroundSupport because the PlaygroundSupport framework provides no functionality to app playgrounds. However, starting in Swift Playground 4.6, you can conditionalize code with the SwiftPlaygrounds condition: #if SwiftPlaygrounds container = NSPersistentContainer(name: myApp, managedObjectModel: Self.createModel()) #else container = NSPersistentCloudKitContainer(name: myApp) #endif
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
Tags: