Swift
Swift
Transition from MailMan.GetAllHeaders to MailMan.FetchAll
Provides instructions for replacing deprecated GetAllHeaders method calls with FetchAll.Chilkat Swift Downloads
func chilkatTest() {
var success: Bool = false
let mailman = CkoMailMan()!
// ...
// ...
var numBodyLines: Int = 5
// ------------------------------------------------------------------------
// The GetAllHeaders method is deprecated:
var bundleObj: CkoEmailBundle? = mailman.getAllHeaders(numBodyLines: numBodyLines)
if mailman.lastMethodSuccess == false {
print("\(mailman.lastErrorText!)")
return
}
// ...
// ...
bundleObj = nil
// ------------------------------------------------------------------------
// Do the equivalent using FetchAll.
// Your application creates a new, empty EmailBundle object which is passed
// in the last argument and filled upon success.
var keepOnServer: Bool = true
var headersOnly: Bool = true
let bundleOut = CkoEmailBundle()!
success = mailman.fetchAll(keepOnServer: keepOnServer, headersOnly: headersOnly, numBodyLines: numBodyLines, bundle: bundleOut)
if success == false {
print("\(mailman.lastErrorText!)")
return
}
}