I updated shortly to Swift 1.2 which comes with Xcode 6.3.2 and wrote a few lines of code:
let originView:UIView!
override init() {
super.init()
}
init(sourceView:UIView, menuItems:Array<String>){
super.init()
originView = sourceView
}
This code runs perfect till I updated the new version of Xcode (6.3.2).
Now I get the following error: Property 'self.originView' not initialized at super.init call
Until now I can't find a solution for this because I'm still learning Swift.
Do someone of you know how I can solve this problem?
P.S It's not a duplicate of this question because of this piece of code: init(sourceView:UIView, menuItems:Array<String>)
instead of override init(frame: CGRect)
.
UPDATE:
New code:
override convenience init() {
self.init()
}
init(sourceView:UIView, menuItems:Array<String>){
originView = sourceView
super.init()
}
New error: Thread 1: EXC_BAD_ACCESS (code=2, address=0x7fff5f300ff8)
in this line of code: self.init()