Sample code for 30+ languages & platforms
Swift Requires Chilkat v11.0.0+

Transition from Cert.GetValidFromDt to Cert.ValidFromStr

Provides instructions for replacing deprecated GetValidFromDt method calls with ValidFromStr.

Chilkat Swift Downloads

Swift

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

    //  ------------------------------------------------------------------------
    //  The GetValidFromDt method is deprecated:

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

    //  ...
    //  ...

    ckdt1 = nil

    //  ------------------------------------------------------------------------
    //  Do the equivalent using the ValidFromStr property

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

}