Sample code for 30+ languages & platforms
Swift

Transition from MailMan.TransferMail to MailMan.FetchAll

Provides instructions for replacing deprecated TransferMail method calls with FetchAll.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

    let mailman = CkoMailMan()!

    // ...
    // ...

    // ------------------------------------------------------------------------
    // The TransferMail method is deprecated:

    var bundleObj: CkoEmailBundle? = mailman.transferMail()
    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 = false
    var headersOnly: Bool = false
    // Irrelevent because we are not downloading headers-only.
    var numBodyLines: Int = 0

    let bundleOut = CkoEmailBundle()!
    success = mailman.fetchAll(keepOnServer: keepOnServer, headersOnly: headersOnly, numBodyLines: numBodyLines, bundle: bundleOut)
    if success == false {
        print("\(mailman.lastErrorText!)")
        return
    }


}