Sample code for 30+ languages & platforms
Swift

Transition from Imap.ListSubscribed to Imap.MbxList

Provides instructions for replacing deprecated ListSubscribed method calls with MbxList.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

    let imap = CkoImap()!

    // ...
    // ...

    var reference: String? = ""
    var mbxPattern: String? = "*"

    // ------------------------------------------------------------------------
    // The ListSubscribed method is deprecated:

    // Lists only subscribed mailboxes.
    var mboxesObj: CkoMailboxes? = imap.listSubscribed(reference: reference, wildcardedMailbox: mbxPattern)
    if imap.lastMethodSuccess == false {
        print("\(imap.lastErrorText!)")
        return
    }

    // ...
    // ...

    mboxesObj = nil

    // ------------------------------------------------------------------------
    // Do the equivalent using MbxList.
    // Your application creates a new, empty Mailboxes object which is passed 
    // in the last argument and filled upon success.

    // Lists only subscribed mailboxes.
    var subscribed: Bool = true

    let mboxes = CkoMailboxes()!
    success = imap.mbxList(subscribed: subscribed, reference: reference, mbxPattern: mbxPattern, mboxes: mboxes)
    if success == false {
        print("\(imap.lastErrorText!)")
        return
    }


}