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 Project-Swift.h
file and I'm not able to find the function while initializing. I have a function defined as below:
public init(userId: Int!) {
self.init(style: UITableViewStyle.Plain)
self.userId = userId
}
I even tried putting @objc(initWithUserId:)
and I keep getting the same error again. Is there anything else I'm missing? How do I get the constructor visible to Objective-C
code?
I read the below for this: