Functions

The following functions are available globally.

  • Returns an NSData object of decoded 64 bit values, could be turned into a byte array, or directly into a NSString

    Declaration

    Objective-C

    NSData *UA_dataFromBase64String(NSString *aString)

    Swift

    func UA_dataFromBase64String(_ aString: String!) -> Data!

    Parameters

    aString

    base 64 encoded NSString that needs to be decoded

    Return Value

    NSData object containing decoded data which can be converted to a byte array or NSString, uses NSASCIIStringEncoding

  • Takes a byte array filled with ASCII encoded representation of data, for our purposes this is a NSString of the app key or secret converted to an NSData object

    Declaration

    Objective-C

    NSString *UA_base64EncodedStringFromData(NSData *data)

    Swift

    func UA_base64EncodedStringFromData(_ data: Data!) -> String!

    Parameters

    data

    NSData representation of a string that needs to be converted to base 64 encoding, expects NSASCIIStringEncoding

    Return Value

    NSString, base 64 encoded using NSASCIIStringEncoding