(Swift) Transition from Imap.FetchSingle to Imap.FetchEmail
Provides instructions for replacing deprecated FetchSingle method calls with FetchEmail. Note: This example requires Chilkat v11.0.0 or greater.
func chilkatTest() {
let imap = CkoImap()!
// ...
// ...
// ------------------------------------------------------------------------
// The FetchSingle method is deprecated:
var emailObj: CkoEmail? = imap.fetchSingle(1, bUid: false)
if imap.lastMethodSuccess == false {
print("\(imap.lastErrorText!)")
return
}
// ...
// ...
emailObj = nil
// ------------------------------------------------------------------------
// Do the equivalent using FetchEmail.
// Your application creates a new, empty Email object which is passed
// in the last argument and filled upon success.
var headerOnly: Bool = false
let email = CkoEmail()!
var success: Bool = imap.fetchEmail(headerOnly, msgId: 1, bUid: false, email: email)
if success == false {
print("\(imap.lastErrorText!)")
return
}
}
|