Data

public extension Data
  • Convert self to an Int value

    Declaration

    Swift

    var toInt: Int { get }
  • Convert self to a binary integer value

    Note

    annotate the return value, e.g. var myInt: Int64 = myData.binInt()

    Declaration

    Swift

    func binInt<T>() -> T where T : BinaryInteger

    Return Value

    a binary integer value

read / write to a local cache file

  • Write to a cache file

    Declaration

    Swift

    func writeToCacheFile(name: String, ext: String) -> URL?

    Parameters

    name

    file name

    ext

    file extension

    Return Value

    URL of nil

  • Initialize self from a local file

    Declaration

    Swift

    init?(fromFileAt url: URL)

    Parameters

    url

    cache file url

  • Return string from data

    Declaration

    Swift

    var string: String { get }
  • Initialize self from string

    Declaration

    Swift

    init?(from string: String)

    Parameters

    string

    input string