swift init not visible in objective-C

前端 未结 2 1350
灰色年华
灰色年华 2020-12-11 15:16

I\'m trying to create init functions in Swift and create instances from Objective-C. The problem is that I don\'t see it in Proj

2条回答
  •  一整个雨季
    2020-12-11 15:48

    use this one:

    var index: NSInteger!
    
    @objc convenience init(index: NSInteger) {
        self.init()
    
        self.index = index
    }
    

提交回复
热议问题