(Swift) Transition from Imap.GetAllUids to Imap.QueryMbx
Provides instructions for replacing deprecated GetAllUids method calls with QueryMbx. Note: This example requires Chilkat v11.0.0 or greater.
func chilkatTest() {
let imap = CkoImap()!
// ...
// ...
// ------------------------------------------------------------------------
// The GetAllUids method is deprecated:
var msgSetObj: CkoMessageSet? = imap.getAllUids()
if imap.lastMethodSuccess == false {
print("\(imap.lastErrorText!)")
return
}
// ...
// ...
msgSetObj = nil
// ------------------------------------------------------------------------
// Do the equivalent using QueryMbx.
// Your application creates a new, empty MessageSet object which is passed
// in the last argument and filled upon success.
let mset = CkoMessageSet()!
var success: Bool = imap.queryMbx("ALL", bUid: true, msgSet: mset)
if success == false {
print("\(imap.lastErrorText!)")
return
}
}
|