我能否使用iOS SDK运行Swift REPL?
我想在REPL中导入并使用UIKit
,但没有成功。
$ xcrun --sdk iphonesimulator8.1 --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk
$ xcrun --sdk iphonesimulator8.1 swift
Welcome to Swift! Type :help for assistance.
1> import UIKit
/var/folders/kb/xgglxb597sv6h8b744d5vft00000gn/T/lldb/92014/repl1.swift:2:8: error: no such module 'UIKit'
import UIKit
^
$ swift -sdk `xcrun --sdk iphonesimulator8.1 --show-sdk-path`
Welcome to Swift! Type :help for assistance.
1> import UIKit
/var/folders/kb/xgglxb597sv6h8b744d5vft00000gn/T/lldb/91881/repl1.swift:2:8: error: no such module 'UIKit'
import UIKit
^
1> import Cocoa
2>
我正在使用 Xcode 版本 6.1 (6A1052d)