String

struct String

These are String class extensions that we’ll use throughout the app.

  • This allows us to easily localize. Simply use this to apply any localization.

    Declaration

    Swift

    var localizedVariant: String { get }
  • This extension lets us uppercase only the first letter of the string (used for weekdays). From here: https://stackoverflow.com/a/28288340/879365

    Declaration

    Swift

    var firstUppercased: String { get }

    Return Value

    The string, with only the first letter uppercased.

  • The following calculated property comes from this: http://stackoverflow.com/a/27736118/879365

    This extension function cleans up a URI string.

    Declaration

    Swift

    var urlEncodedString: String? { get }

    Return Value

    a string, cleaned for URI.