swift3.0中 無法使用XCPlayground
在swift3.0、XCode8中,無法使用XCPlayground進行動畫預覽,怎么解決?
查詢了下文檔,好想要import PlaygroundSupport?但也無法預覽,而且打開AssitantView的時候Xcode會崩潰
在swift3.0、XCode8中,無法使用XCPlayground進行動畫預覽,怎么解決?
查詢了下文檔,好想要import PlaygroundSupport?但也無法預覽,而且打開AssitantView的時候Xcode會崩潰
2016-09-20
舉報
2016-09-22
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;