Sample code for 30+ languages & platforms
Swift Requires Chilkat v11.0.0+

Transition from MailMan.LoadXmlString to EmailBundle.LoadXmlString

Provides instructions for replacing deprecated LoadXmlString method calls with EmailBundle.LoadXmlString.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

    let mailman = CkoMailMan()!

    //  ...
    //  ...

    var xmlBundleStr: String? = "..."

    //  ------------------------------------------------------------------------
    //  The LoadXmlString method is deprecated:

    var bundleObj: CkoEmailBundle? = mailman.loadXmlString(xmlString: xmlBundleStr)
    if mailman.lastMethodSuccess == false {
        print("\(mailman.lastErrorText!)")
        return
    }

    //  ...
    //  ...

    bundleObj = nil

    //  ------------------------------------------------------------------------
    //  Do the equivalent using EmailBundle.LoadXmlString.

    let bundle = CkoEmailBundle()!
    success = bundle.loadXmlString(xmlStr: xmlBundleStr)
    if success == false {
        print("\(bundle.lastErrorText!)")
        return
    }


}