Is it possible to load a storyboard in an iOS Playground? Follow the steps in this questions:
How do you instantiate a Storyboard from a file within an iOS playground?
Compiled Main.storyboard using
ibtool --compile MainMenu.nib MainMenu.storyboard
Added it to the Resources
folder of the playground. Then tried loading it:
let storyboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle())
This resulting in an error:
Playground execution aborted: Execution was interrupted, reason: signal SIGABRT.
Is this supported in XCode 7.3.1 or even XCode 8?
In Swift Playgrounds, you can see live Previews of your SwiftUI views just like Previews in Xcode. In a . swiftpm project, you have a default App Preview that generates from the structure that conforms to the App protocol.
The Swift programming language was designed to be approachable enough to be your very first programming language. Swift is also incredibly powerful, used by professional developers to create over half a million apps on the App Store. Using Swift Playgrounds, you'll be coding within minutes.
Interactive playgrounds help you to quickly prototype and build your applications, and simply provide another great way to interact with your code. An Xcode project, however, creates a new asset folder and pre-made swift and storyboard files. Save this answer.
Swift Playgrounds teaches concepts and uses real Swift structure, but it's not real code. It doesn't make an app, it just guides Byte around and solves puzzles.
Your storyboard init code works for me if I set up the resource section of the playground with the same structure as an app.
Resources->Base.lproj->Main.storyboardc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With