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