> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.qonversion.io/llms.txt
> Use this file to discover all available pages before exploring further.

# iOS 5.+ migration guide

## Renamings

In this major version, we have renamed several entities and public methods to make our namings more clear. To make everything work just change all the occurrences from the left column of the table below to the new ones.

| Before upgrade                                | After upgrade                                               |
| --------------------------------------------- | ----------------------------------------------------------- |
| `QONProperty` (swift - `Qonversion.Property`) | `QONUserPropertyKey` (swift - `Qonversion.UserPropertyKey`) |
| `setUserProperty`                             | `setCustomUserProperty`                                     |
| `setProperty`                                 | `setUserProperty`                                           |

## User properties changes

In addition to the above renamings we have added a new class `QONUserProperty`, containing both the property key and its value. This class will be used in the new Qonversion method `userProperties`, which will return all the properties set for the current user.

<CodeGroup>
  ```swift Swift theme={null}
  Qonversion.shared().userProperties({ userProperties, error in
    if let error = error {
      // Handle error
      return
    }
    
    userProperties?.properties.forEach({ userProperty in
      print("User property: ", "key: ", userProperty.key, ", value: ", userProperty.value)
    })
  });
  ```

  ```objectivec Objective-C theme={null}
  [[Qonversion sharedInstance] userProperties:^(QONUserProperties * _Nullable userProperties, NSError * _Nullable error) {
    if (error) {
      // Handle error
      return;
    }

    [userProperties.properties enumerateObjectsUsingBlock:^(QONUserProperty * _Nonnull userProperty, NSUInteger idx, BOOL * _Nonnull stop) {
      NSLog(@"User property: key: %@, value: %@", userProperty.key, userProperty.value);
    }];
  }];
  ```
</CodeGroup>

`QONUserProperties` class returned as the successful result of `userProperties` contains several useful fields and methods to get all the types of properties you may want:

| Field                      | Description                                                                 |
| -------------------------- | --------------------------------------------------------------------------- |
| `properties`               | List of all user properties                                                 |
| `definedProperties`        | Subset of all user properties, which were set using Qonversion-defined keys |
| `customProperties`         | Subset of all user properties, which were set using custom keys             |
| `flatPropertiesMap`        | A flattened version of all user properties as a key-value map               |
| `flatDefinedPropertiesMap` | A flattened version of defined user properties as a key-value map           |
| `flatCustomPropertiesMap`  | A flattened version of custom user properties as a key-value map            |

| Method                  | Arguments                    | Description                                                                                              |
| ----------------------- | ---------------------------- | -------------------------------------------------------------------------------------------------------- |
| `propertyForKey`        | `key` - string               | Searches for a property with the given property `key` in all properties list                             |
| `definedPropertyForKey` | `key` - `QONUserPropertyKey` | Searches for a property with the given Qonversion-defined property `key` in the defined properties list. |

The last change here is that we've enriched `QONUserPropertyKey` enum with several values:

* added new property keys `FacebookAttribution` and `AppSetId`, which is used on Android but can be received on iOS due to cross-platform user management;
* added a `Custom` key to represent all the custom properties.

***

[\[Aug 2023\] Migration Guide](qonversion-sdk-major-version)

[Android 6.+ migration guide](android-6-migration-guide)
