Build error when trying to override an initializer in Xcode 6.3 Beta 3

后端 未结 3 670
醉酒成梦
醉酒成梦 2020-12-06 00:42

The following code shows build error in Xcode 6.3 Beta 3. The code works in Xcode 6.2 and Xcode 6.3 Beta 2.

class MyView: UIView {
  overrid         


        
3条回答
  •  臣服心动
    2020-12-06 01:30

    An additional way of resolving is to provide a default argument for the frame parameter of the UIView

    override init(frame: CGRect = CGRectZero) {
         super.init(frame: frame)
         // custom code
    }
    

提交回复
热议问题