Recently I've been trying to use MailCore2 inside my react-native app to read mails, so I made a RCTBridge in Swift for it, and I want to return a simple html string of fetched messages... I have successfully fetched messages of type [MCOIMAPMessage] and now I want to map over this array to convert it to html string with the following code
let msgs = (ret.value(forKey: "messages") as! [MCOIMAPMessage]).map{
[
"html": $0.htmlRendering(withFolder: folder as String,
delegate: MCOHTMLRendererIMAPDelegate()) as NSString,
] as NSDictionary
}
Obviously it gives an error, can somebody please tell me the right way to do it...? Or at least tell me how to implement a MCOHTMLRendererIMAPDelegate