Extensions

The following extensions are available globally.

  • Adds MapKey support to a String. The string will be parsed into a MapKey by pulling out all key parts in the string. Key parts are seperated using ..

    For example, the string first.second[].third will be converted to the following key parts: 1 KeyPart.object("first") 2 KeyPart.array("second") 3 KeyPart.object("third")

    This key can be used to return the value My Value, from third in the following JSON dictionary:

    {
       "first": {
           "second": [
               {
                   "third": "My Value"
               }
           ]
       }
    }
    

    Using this key when storing a value in the map will, on the other hand create the above dictionary.

    See more

    Declaration

    Swift

    struct String
  • Declaration

    Swift

    struct Array<Element> : _DestructorSafeContainer