import UIKit
import PlaygroundSupport
let view = UIView(frame: CGRect(x: 100, y: 100, width: 100, height: 100))
view.backgroundColor = .blue
PlaygroundPage.current.liveView = view
参考博客:
直接在playground上开发iOS界面
import UIKit
import PlaygroundSupport
let view = UIView(frame: CGRect(x: 100, y: 100, width: 100, height: 100))
view.backgroundColor = .blue
PlaygroundPage.current.liveView = view
参考博客:
直接在playground上开发iOS界面