Sample code for 30+ languages & platforms
Swift

Transition from Cert.GetValidToDt to Cert.ValidToStr

Provides instructions for replacing deprecated GetValidToDt method calls with ValidToStr.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    let cert = CkoCert()!

    // ------------------------------------------------------------------------
    // The GetValidToDt method is deprecated:

    var ckdt1: CkoDateTime? = cert.getValidToDt()
    if cert.lastMethodSuccess == false {
        print("\(cert.lastErrorText!)")
        return
    }

    // ...
    // ...

    ckdt1 = nil

    // ------------------------------------------------------------------------
    // Do the equivalent using the ValidToStr property

    let ckdt2 = CkoDateTime()!
    ckdt2.set(fromRfc822: cert.validToStr)

}