Swift
Swift
Transition from MailMan.FetchMultiple to MailMan.FetchUidlSet
Provides instructions for replacing deprecated FetchMultiple method calls with FetchUidlSet.Chilkat Swift Downloads
func chilkatTest() {
var success: Bool = false
let mailman = CkoMailMan()!
// ...
// ...
let saUidls = CkoStringArray()!
saUidls.append(str: "aaa")
saUidls.append(str: "bbb")
saUidls.append(str: "ccc")
let stUidls = CkoStringTable()!
stUidls.append(value: "aaa")
stUidls.append(value: "bbb")
stUidls.append(value: "ccc")
// ------------------------------------------------------------------------
// The FetchMultiple method is deprecated:
var bundleObj: CkoEmailBundle? = mailman.fetchMultiple(uidlArray: saUidls)
if mailman.lastMethodSuccess == false {
print("\(mailman.lastErrorText!)")
return
}
// ...
// ...
bundleObj = nil
// ------------------------------------------------------------------------
// Do the equivalent using FetchUidlSet.
// Your application creates a new, empty EmailBundle object which is passed
// in the last argument and filled upon success.
var headersOnly: Bool = false
// Irrelevant because we are not downloading headers-only.
var numBodyLines: Int = 0
let bundleOut = CkoEmailBundle()!
success = mailman.fetchUidlSet(uidls: stUidls, headersOnly: headersOnly, numBodyLines: numBodyLines, bundle: bundleOut)
if success == false {
print("\(mailman.lastErrorText!)")
return
}
}