Sample code for 30+ languages & platforms
Swift

Transition from Zip.GetEntryByIndex to Zip.EntryAt

Provides instructions for replacing deprecated GetEntryByIndex method calls with EntryAt.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

    let zip = CkoZip()!

    // ...
    // ...
    var index: Int = 15

    // ------------------------------------------------------------------------
    // The GetEntryByIndex method is deprecated:

    var entryObj: CkoZipEntry? = zip.getEntry(byIndex: index)
    if zip.lastMethodSuccess == false {
        print("\(zip.lastErrorText!)")
        return
    }

    // ...
    // ...

    entryObj = nil

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

    let ze = CkoZipEntry()!
    success = zip.entry(at: index, entry: ze)
    if success == false {
        print("\(zip.lastErrorText!)")
        return
    }


}