这就是我在Obejective C中调用UIView DraggableViewBackground的方法,它工作得很好但是如何在Swift中做同样的事情
DraggableViewBackground *draggableBackgroundforurl = [[DraggableViewBackground alloc]initWithFrame:self.view.frame];
Run Code Online (Sandbox Code Playgroud)
我的DraggableViewBackground在Objective C中,我希望在单击按钮时将其设置为子视图
let draggableBackgroundforurl = DraggableViewBackground(frame: self.view.frame);
Run Code Online (Sandbox Code Playgroud)
这应该够了吧.
您可以在这种情况下查找区别let并var确定最适合您需求的区别.let不能改变,var可以.
| 归档时间: |
|
| 查看次数: |
7087 次 |
| 最近记录: |