【发布时间】:2015-08-12 21:27:27
【问题描述】:
我有代码
UIView.animateWithDuration(0.5, delay: 0.4,
options: .Repeat, animations: {
// self.circle.center += 10
}, completion: nil)
}
编译。
但是如果我取消注释行
self.circle.center += 10 我会有 ViewController.swift:28:23: 找不到成员“重复”。
self.circle 是 @IBOutlet var circle: Circle!
连接到 Main.storyboard 上的某个对象。
Circle 是使用自定义 drawRect 扩展 UIView 的类。
所有这些东西有什么问题?
【问题讨论】:
-
center 是 CGPoint 所以你不能 += 10,你需要增加它的 x 或 y 属性
标签: ios swift uiview xcode6 animatewithduration