(Swift) Transition from MailMan.LoadXmlString to EmailBundle.LoadXmlString
Provides instructions for replacing deprecated LoadXmlString method calls with EmailBundle.LoadXmlString. Note: This example requires Chilkat v11.0.0 or greater.
func chilkatTest() {
let mailman = CkoMailMan()!
// ...
// ...
var xmlBundleStr: String? = "..."
// ------------------------------------------------------------------------
// The LoadXmlString method is deprecated:
var bundleObj: CkoEmailBundle? = mailman.loadXmlString(xmlBundleStr)
if mailman.lastMethodSuccess == false {
print("\(mailman.lastErrorText!)")
return
}
// ...
// ...
bundleObj = nil
// ------------------------------------------------------------------------
// Do the equivalent using EmailBundle.LoadXmlString.
let bundle = CkoEmailBundle()!
var success: Bool = bundle.loadXmlString(xmlBundleStr)
if success == false {
print("\(bundle.lastErrorText!)")
return
}
}
|