I'm using XLForm, which has a class XLFormDescriptor, which needs to be initialized with init(title: String).
The title I want to use is the return value of my current class's name function (class-level properties aren't a feature yet).
Putting this at a class level, the code to set it up looks like this:
let settingsForm = XLFormDescriptor(title: self.name())
But this gives the error:
'PanelController -> () -> PanelController!' does not have a member named 'name'
Putting this at the top of the class's init call looks like this:
let settingsForm: XLFormDescriptor
override init() {
self.settingsForm = XLFormDescriptor(title: self.dynamicType.name())
super.init()
}
And doing that gives this error:
'self' used before super.init call
Putting it after super.init() gives this error:
Property 'settingsForm' not initialized at super.init call
Any ideas how I can possibly do this?
EDIT: A workaround is to do this:
let settingsForm = XLFormDescriptor(title: "")
override init() {
super.init()
self.settingsForm = XLFormDescriptor(title: self.dynamicType.name())
}