i'm trying to create the following extension in Swift:
extension MFMailComposeViewController {
convenience init(document: Document) {
self.init()
// do some configuration...
setMessageBody("BlaBlaBla", isHTML: false)
}
}
However I am not able to get this to compile:
Cannot invoke 'MFMailComposeViewController.init' with no arguments
Which seems strange to me because MFMailComposeViewController
definitely has an initialiser with no arguments.
Any help on how to fix this issue would be greatly appreciated.
For sublcassing use
super.init()
instead ofself.init()
and for extensions self