BeBeBerr3477889
2016-09-20 20:30
在swift3.0、XCode8中,无法使用XCPlayground进行动画预览,怎么解决?
查询了下文档,好想要import PlaygroundSupport?但也无法预览,而且打开AssitantView的时候Xcode会崩溃
import UIKit import XCPlayground import PlaygroundSupport var wrap = UIView(frame: CGRect(x: 0, y: 0, width: 300, height: 300)); var rect = UIView(frame: CGRect(x: 0, y: 0, width: 50, height: 50)); rect.center = wrap.center; rect.backgroundColor = UIColor.red; wrap.addSubview(rect); //animation UIView.animate(withDuration: 3){ rect.backgroundColor = UIColor.green; rect.frame = wrap.frame; }; //XCPlaygroundPage.currentPage.liveView=wrap; PlaygroundPage.current.liveView=wrap;
玩儿转Swift 2.0(第二季)
15832 学习 · 54 问题
相似问题