How does one invoke the Swift REPL for iOS? I tried the command line argument of swift -sdk ...
and have looked, via swift -h
, at the other invocation arguments but none jumps out at me.
$ swift
Welcome to Swift! Type :help for assistance.
1> import UIKit
<REPL>:1:8: error: no such module 'UIKit'
import UIKit
^
The Swift REPL runs in a Playground in 'iOS' mode on a Mac; just looking to get the same from the command line.
One way to do this is to create an iOS/OS X project and set a break point to interrupt the flow. Then, enter repl
into the lldb console and enjoy.
For more on this one, watch WWDC 2014 session 409 - Introduction to LLDB and the Swift REPL.
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