Adding key value pairs - adform/adform-ios-sdk GitHub Wiki

Adding keywords to ad views

To add key-value pairs which will be used for targeting purposes please use the example below:

 adView.keyValues = [AFKeyValue(key: "gender", value: "male"), AFKeyValue(key: "age", value: "20-30")]

If you were previously setting a dictionary to the "keyValues" property (SDK versions older than 2.7.2), you can use a convenience function to transform dictionary to key values array automatically:

 adView.keyValues = AFKeyValuesFromNSDictionary(["gender": "male", "age": "20"])

Important, both key and value have a 200 character limit.