Sample code for 30+ languages & platforms
Swift

Transition from Zip.AppendSb to Zip.AddSb

Provides instructions for replacing deprecated AppendSb method calls with AddSb.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

    let zip = CkoZip()!

    // ...
    // ...
    var pathInZip: String? = "example.txt"
    let sb = CkoStringBuilder()!
    sb.append(value: "This is a test")
    var charset: String? = "utf-8"

    // ------------------------------------------------------------------------
    // The AppendSb method is deprecated:

    success = zip.appendSb(pathInZip: pathInZip, sb: sb, charset: charset)

    // ------------------------------------------------------------------------
    // For consistency, the name has changed to AddSb.

    success = zip.addSb(pathInZip: pathInZip, sb: sb, charset: charset)

}