(Swift) Transition from Crypt2.LastJsonData to Crypt2.GetLastJsonData
Provides instructions for replacing deprecated LastJsonData method calls with GetLastJsonData. Note: This example requires Chilkat v11.0.0 or greater.
func chilkatTest() {
let crypt2 = CkoCrypt2()!
// ...
// ...
// ------------------------------------------------------------------------
// The LastJsonData method is deprecated:
var jsonObj: CkoJsonObject? = crypt2.lastJsonData()
if crypt2.lastMethodSuccess == false {
print("\(crypt2.lastErrorText!)")
return
}
// ...
// ...
jsonObj = nil
// ------------------------------------------------------------------------
// Do the equivalent using GetLastJsonData.
// Your application creates a new, empty JsonObject object which is passed
// in the last argument and filled upon success.
let jsonOut = CkoJsonObject()!
var success: Bool = crypt2.getLastJsonData(jsonOut)
if success == false {
print("\(crypt2.lastErrorText!)")
return
}
}
|