如何在iOS上调用Swift REPL?我尝试了swift -sdk ...
的命令行参数,并查看了其他调用参数(通过swift -h
),但没有一个对我来说是最合适的。
$ swift
Welcome to Swift! Type :help for assistance.
1> import UIKit
<REPL>:1:8: error: no such module 'UIKit'
import UIKit
^
Swift REPL 可以在Mac上的“iOS”模式下的 Playground 中运行;现在只是想从命令行中获得相同的功能。