Sample code for 30+ languages & platforms
Swift Requires Chilkat v11.0.0+

Transition from MailMan.FetchMultipleHeaders to MailMan.FetchUidlSet

Provides instructions for replacing deprecated FetchMultipleHeaders method calls with FetchUidlSet.

Chilkat Swift Downloads

Swift

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")

    var numBodyLines: Int = 5

    //  ------------------------------------------------------------------------
    //  The FetchMultipleHeaders method is deprecated:

    var bundleObj: CkoEmailBundle? = mailman.fetchMultipleHeaders(uidlArray: saUidls, numBodyLines: numBodyLines)
    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 = true

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


}