Sample code for 30+ languages & platforms
Swift

Decode Base64

Demonstrates how to decode base64.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

    let bd = CkoBinData()!

    // Append a base64 string to bd.
    success = bd.appendEncoded(encData: "c2VjcmV0", encoding: "base64")

    // The bd now contains the decoded bytes.
    // Let's say it was a password string..
    var password: String? = bd.getString(charset: "utf-8")

    // Decodes to "secret".
    print("password = \(password!)")

}