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