---
title: "Contentstack Delivery Objective C SDK"
description: "Documentation for Objective C  Delivery SDK"
url: "https://www.contentstack.com/docs/developers/sdks/content-delivery-sdk/ios/reference"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2025-09-15"
---

# Contentstack Delivery Objective C SDK

## Contentstack - Objective-C Delivery SDK

## Objective C SDK for Contentstack's Content Delivery API

Contentstack is a headless CMS with an API-first approach. It is a CMS that developers can use to build powerful cross-platform applications in their favorite languages. Build your application frontend, and Contentstack will take care of the rest. [Read More](https://www.contentstack.com/).

## Prerequisites

To get started with iOS SDK, you will need the following:

*   Latest version of Xcode
*   Objective-C and Swift 4.2 and above
*   iOS 10 or later.

## SDK installation and setup

Contentstack offers seven [regions](/docs/developers/contentstack-regions/about-regions) AWS North America (AWS NA), AWS Europe (AWS EU), AWS Australia (AWS AU), Azure North America (AZURE NA), Azure Europe (AZURE EU), GCP North America(GCP NA), and GCP Europe(GCP EU) as data centers to store customers' account details and data. These regions are independent of each other and therefore have a dedicated set of instructions to use SDKs offered by Contentstack.

To use SDKs for the Europe, Australia, Azure NA, or Azure EU region, you will have to make certain changes in the configuration of the SDK, as detailed below, and the rest of the instructions remain the same.

To add the Contentstack iOS SDK to your existing project, perform the following steps:

**SDK Installation:**

You can use the SDK using CocoaPods. Add the following line to your Podfile:

pod 'Contentstack'

Then, run the command given below to get the latest release of Contentstack.

pod install

**Import header/module:**

You can either import the header or the module. Import the header file in Objective-C project using the command given below:

#import <Contentstack/Contentstack.h>

Import the header files as a module too:

1.  Swift
    
    import Contentstack
    
2.  Objective C
    
    @import Contentstack

## Quickstart in 5 mins

## Initialize SDK

To initialize the SDK, specify application context, the stack’s API key, Delivery token, and name of the environment where you will publish the content, as shown in the snippet below:

1.  Swift
    
    let stack:Stack = Contentstack.stack(withAPIKey: "API\_KEY", accessToken:"DELIVERY\_TOKEN", environmentName:"ENVIRONMENT")
    
2.  Objective C
    
    Stack \*stack = \[Contentstack stackWithAPIKey:@"API\_KEY" accessToken:@"DELIVERY\_TOKEN" environmentName:@"ENVIRONMENT"\];
    

**For Setting other Regions:**

To set and use the SDK for the AWS Europe, AWS AU, Azure NA, Azure EU, GCP NA, or GCP EU region refer to the code below:

1.  Swift
    
    var config: Config = Config();
    config.region = ContentstackRegion.EU; //ContentstackRegion.AU; or ContentstackRegion.AZURE\_NA or ContentstackRegion.AZURE\_EU or ContentstackRegion.GCP\_NA or ContentstackRegion.GCP\_EU
    
    lt stack:Stack = Contentstack.stack(withAPIKey: "API\_KEY", accessToken:"DELIVERY\_TOKEN",environmentName:"ENVIRONMENT", config:config)
    
2.  Objective C
    
    Config \*config = \[\[Config alloc\] init\];
    config.region = EU; //AU or AZURE\_NA or AZURE\_EU or GCP\_NA or GCP\_EU
     Stack \*stack = \[Contentstack stackWithAPIKey:@"API\_KEY" accessToken:@"DELIVERY\_TOKEN" environmentName:@"ENVIRONMENT" config:config\];
    

Once you have initialized the SDK, you can query entries to fetch the required content.

**For Setting the Branch:**

If you want to initialize SDK in a particular branch use the code given below:

1.  Swift
    
    var config: Config = Config();
    config.branch = "branch";
    let stack:Stack = Contentstack.stack(withAPIKey: "API\_KEY", accessToken:"DELIVERY\_TOKEN",environmentName:"ENVIRONMENT", config:config)
    
2.  Objective C
    
    Config \*config = \[\[Config alloc\] init\];
    config.branch = @"branch";
    Stack \*stack = \[Contentstack stackWithAPIKey:@"API\_KEY" accessToken:@"DELIVERY\_TOKEN" environmentName:@"ENVIRONMENT" config:config\];

## Basic Queries

**Get a Single Entry**

To retrieve a single entry from a content type, use the code snippet given below:

1.  Swift
    
    let stack:Stack = Contentstack.stack(withAPIKey: "API\_KEY", accessToken:"DELIVERY\_TOKEN", environmentName:"ENVIRONMENT")  
      
    var contentType:ContentType = stack.contentType(withName: "CONTENT\_TYPE\_UID")  
    var entry:Entry = contentType.entry(withUID: "ENTRY\_UID")  
    entry.fetch { (responseType, error) -> Void in  
    }  
    
2.  Objective C
    
    Stack \*stack = \[Contentstack stackWithAPIKey:@"API\_KEY" accessToken:@"DELIVERY\_TOKEN" environmentName:@"ENVIRONMENT"\];  
      
    ContentType \*contentType = \[stack contentTypeWithName:@"CONTENT\_TYPE\_UID"\];  
    Entry \*entry  = \[contentType entryWithUID:@"ENTRY\_UID"\];  
    \[entry fetch:^(ResponseType type, NSError \* \_Nullable error) {  
      
    }\];  
    

**Get Multiple Entries**To retrieve multiple entries of a particular content type, use the code snippet given below:

1.  Swift
    
    let stack:Stack = Contentstack.stack(withAPIKey: "API\_KEY", accessToken:"DELIVERY\_TOKEN", environmentName:"ENVIRONMENT")  
      
    var contentType:ContentType = stack.contentType(withName: "CONTENT\_TYPE\_UID")  
    var query: Query = contentType.query()  
    query.find { (responseType, result, error) -> Void in  
    }  
    
2.  Objective C
    
    Stack \*stack = \[Contentstack stackWithAPIKey:@"API\_KEY" accessToken:@"DELIVERY\_TOKEN" environmentName:@"ENVIRONMENT"\];  
      
    ContentType \*contentType = \[stack contentTypeWithName:@"CONTENT\_TYPE\_UID"\];  
    Query \*query  = \[contentType <span>query</span>\];  
    \[query find:^(ResponseType type,  QueryResult \*result,, NSError \* \_Nullable error) {  
      
    }\];

## Paginating Responses

In a single instance, the [Get Multiple Entries](https://www.contentstack.com/docs/developers/dot-net/get-started-with-dot-net-delivery-sdk/#get-multiple-entries) query will **retrieve only the first 100 items** of the specified content type. You can paginate and retrieve the rest of the items in batches using the skip and limit parameters in subsequent requests.

1.  Swift
    
    let stack:Stack = Contentstack.stack(withAPIKey: "API\_KEY", accessToken:"DELIVERY\_TOKEN", environmentName:"ENVIRONMENT")  
      
    var contentType:ContentType = stack.contentType(withName: "CONTENT\_TYPE\_UID")  
    var query:Query = contentType.query()  
        query.limitObjects(NSNumber(int:20))  
    query.skipObjects(NSNumber(int: 20))  
    query.find { (responseType, result!, error!) -> Void in  
    }
    
2.  Objective C
    
    Stack \*stack = \[Contentstack stackWithAPIKey:@"API\_KEY" accessToken:@"DELIVERY\_TOKEN" environmentName:@"ENVIRONMENT"\];  
      
    ContentType \*contentType = \[stack contentTypeWithName:@"CONTENT\_TYPE\_UID"\];  
    Query \*query  = \[contentType query</span>\];  
    \[query limitObjects:@(20)\];  
    \[query skipObjects:@(20)\];  
    \[query find:^(ResponseType type, QueryResult \*result, NSError \*error) {  
      
    }\];

## Contentstack

Contentstack class that exposes Stack instance

## stackWithAPIKey:accessToken:environmentName:

Create a new Stack instance with stack’s API key, Delivery token, and Environment.

Stack API Key.

Environment specific delivery token.

Stack environment id to fetch content

## stackWithAPIKey:accessToken:environmentName:config:

Create a new Stack instance with stack’s API key, Delivery token, Environment and Config.

Stack API Key.

Environment specific delivery token.

Stack environment id to fetch content

Config of stack.

## cancelAllRequestsOfStack:

Cancel all network request for Stack instance.

Instance of Stack.

## CachePolicy

The cache policies allow you to define the source from where the SDK will retrieve the content. Based on the selected policy, the SDK can get the data from cache, network, or both.Let’s look at the various cache policies available for use:  
  

**POLICIES**

**DESCTIPTION**

NETWORK\_ONLY (default)

If you set NETWORK\_ONLY as the cache policy, the SDK retrieves data through a network call, and saves the retrieved data in the cache. This is set as the default policy.

CACHE\_ELSE\_NETWORK

If you set CACHE\_ELSE\_NETWORK as the cache policy, the SDK gets data from the cache. However, if it fails to retrieve data from the cache, it makes a network call.

NETWORK\_ELSE\_CACHE

If you set NETWORK\_ELSE\_CACHE as the cache policy, the SDK gets data using a network call. However, if the call fails, it retrieves data from cache.

CACHE\_THEN\_NETWORK

If you set CACHE\_THEN\_NETWORK as the cache policy, the SDK gets data from cache, and then makes a network call. (A success callback will be invoked twice.)

CACHE\_ONLY

If you set CACHE\_ONLY as the cache policy, the SDK gets data from the cache.

## ContentstackRegion

**Fields**

NAME

DESCRIPTION

EU

To specify the EU region

AU

To specify the AU region

US

To specify the US region

AZURE\_NA

To specify the AZURE NA region

AZURE\_EU

To specify the AZURE EU region

GCP\_NA

To specify the GCP NA region

GCP\_EU

To specify the GCP EU region

## Config

Stack configuration for setting stack details.

## setEarlyAccess

With the setEarlyAccess header support, you can access features that are part of the early access program.

Host name of Contentstack api server.

You can choose from seven regions namely NA, EU, AU, Azure NA, Azure EU, GCP NA and GCP EU.

API version of Contentstack api server.

Branch id for getting content from Stack

## PublishType

**Publish type is to sync specific type of contents:**

NAME

DESCRIPTION

ASSET\_PUBLISHED

To get only published asset in sync

ENTRY\_PUBLISHED

To get only published entries in sync

ASSET\_UNPUBLISHED

To get only unpublished assets in sync

ENTRY\_UNPUBLISHED

To get only unpublished entries in sync

ASSET\_DELETED

To get only deleted assets in sync

ENTRY\_DELETED

To get only deleted entries in sync

CONTENT\_TYPE\_DELETED

To get only content for deleted ContentType in sync

## ResponseType

**Publish type is to sync specific type of contents:**

NAME

DESCRIPTION

CACHE

Specified response is from the cache.

NETWORK

Specified response is from the network.

## OrderBy

**Publish type is to sync specific type of contents:**

NAME

DESCRIPTION

OrderByAscending

Order by ascending

OrderByDescending

Order by descending

## SyncStack

Represents the result of a sync operation.

Readonly property contains all the Contents

Readonly property to check skip count

Readonly property to check limit

Readonly property to check totalCount

Readonly property for paginating sync

Readonly property to delta sync.

## Stack

Initialize an instance of ‘Stack’

## contentTypeWithName:

Gets the new instance of ContentType object with specified name.

Uid of the contentType to perform action.

## setHeader:forKey:

Set a header for Stack.

The header value

The header key

## addHeadersWithDictionary:

Set a header for Stack

The headers as dictionary which needs to be added to the application.

## removeHeaderForKey:

Removes a header from this Stack.

The header key that needs to be removed.

## assetLibrary

Represents a Asset on ‘Stack’ which can be executed to get AssetLibrary object.

## asset

Represents an Asset on ‘Stack’ which can be executed to get Asset object.

## assetWithUID:

Gets the new instance of Asset object with specified UID.

Uid of the Asset object to fetch.

## imageTransformWithUrl:andParams:

Transforms provided image url based on transformation parameters.

Url on which transformations to be applied.

Transformation parameters.

## getContentTypes:completion:

Gets all the ContentTypes and its Schema definition.

params is dictionary of additional parameter

completionBlock to be called once operation is done.

## sync:

The Initial Sync request performs a complete sync of your app data. It returns all the published entries and assets of the specified stack in response. The response also contains a sync token, which you need to store, since this token is used to get subsequent delta updates later.

completionBlock called synchronization is done.

## syncPaginationToken:completion:

If the result of the initial sync (or subsequent sync) contains more than 100 records, the response would be paginated. It provides pagination token in the response. However, you do not have to use the pagination token manually to get the next batch, the SDK does that automatically until the sync is complete. Pagination token can be used in case you want to fetch only selected batches. It is especially useful if the sync process is interrupted midway (due to network issues, etc.). In such cases, this token can be used to restart the sync process from where it was interrupted.

Pagination token from where to perform sync

completionBlock called synchronization is done.

## syncToken:completion:

You can use the sync token (that you receive after initial sync) to get the updated content next time. The sync token fetches only the content that was added after your last sync, and the details of the content that was deleted or updated.

Sync token from where to perform sync

completionBlock called synchronization is done.

## syncOnly:completion:

Perform a synchronization operation on specified classes.

ContentType uids of classes to be expected.

completionBlock called synchronization is done.

## syncFrom:completion:

Perform a synchronization operation on specified date.

Date from where sync data is needed.

completionBlock called synchronization is done.

## syncOnly:from:completion:

Perform a synchronization operation on specified classes, and date.

ContentType uids of classes to be expected.

Date from where sync data is needed.

completionBlock called synchronization is done.

## syncPublishType:completion:

Perform a synchronization operation on specified publishType.

PublishType for which sync is needed.

completionBlock called synchronization is done.

## syncLocale:completion:

Perform a synchronization operation on specified locale.

Locale for which sync is needed.

completionBlock called synchronization is done.

## syncLocale:from:completion:

Perform a synchronization operation on locale, and date.

Locale for which sync is needed.

Date from where sync data is needed.

completionBlock called synchronization is done.

## syncOnly:locale:from:completion:

Perform a synchronization operation on specified classes, locale and date.

ContentType uids of classes to be expected.

Locale for which sync is needed.

Date from where sync data is needed.

completionBlock called synchronization is done.

## syncOnly:locale:from:publishType:completion:

Perform a synchronization operation on specified classes, locale, date and publishType.

ContentType uids of classes to be expected.

Locale for which sync is needed.

Date from where sync data is needed.

PublishType for which sync is needed.

completionBlock called synchronization is done.

Readonly property for Stack API Key

Readonly property for Stack of access token/delivery token specific to environment

Read only property of Stack environment to get content.

Read only property of Stack configuration.

## ContentType

ContentType provides Entry and Query instance.

## setHeader:forKey:

Set a header for Stack.

The header value

The header key

## addHeadersWithDictionary:

Set a header for Stack ContentType

The headers as dictionary which needs to be added to the application.

## removeHeaderForKey:

Removes a header from this Stack.

The header key that needs to be removed.

## entryWithUID:

Gets the new instance of Entry object with specified UID.

Uid of the Entry object to fetch.

## query

Represents a Query on ‘ContentType’ which can be executed to retrieve entries that pass the query condition

## fetch:completion:

Gets ContentType Schema definition.

Fetch query parameters

Block to be called once operation is done.

## Asset

The Asset class represents a single asset and fetches its metadata from the delivery API.

**Note:** For files **over 4 GB**, fileSize may overflow due to 32-bit type limits and may not represent the actual file size.

## setLocale

The setLocale method sets the locale code used when fetching the asset so the response is in the requested language.

User-defined locale code for the request (e.g., en-us). Specifies the language of the content returned during the fetch operation.

## configureWithDictionary

The configureWithDictionary method configures the assets’ in-memory metadata (for example, after a fetch or for local use).

*   **Request behavior:** This method does not modify request parameters for fetch.
*   **For request parameters:** Use setLocale:, includeMetadata, or addParamKey:andValue:.

**Key–value pairs** used to set the asset’s stored metadata (for example, uid, fileName, url). Replaces existing values for the provided keys.

## addParamKey:andValue

The addParamKey:andValue method adds a query parameter key–value pair to the Asset. The SDK sends the parameter with the next fetch request (for example, include\_dimension, locale, or other supported API keys).

User-defined key for the query parameter. Specifies the key sent during the fetch operation.

User-defined value for the query parameter. Specifies the value sent during the fetch operation.

## setHeader:forKey:

The setHeader:forKey sets a header for the Asset.

The header value

The header key

## addHeadersWithDictionary:

The addHeadersWithDictionary method sets a single header on the Asset.

*   **Multiple headers:** Use addHeadersWithDictionary:.
*   **Override behavior:** Headers set on the Asset override the same header from the Stack for that request only.

The headers as dictionary which needs to be added to the application.

## removeHeaderForKey:

The removeHeaderForKey removes a header from this Asset.

The header key that needs to be removed.

## includeMetadata

The includeMetadata method Includes metadata in the response body.

## includeBranch

The includeBranch retrieves the branch for the published content.

## fetch:

The fetch fetches an asset asynchronously (by UID or with a query built on the instance).

Block to be called once operation is done.

Returns the filename of the asset

Returns the size of the asset file

Returns the file type of the asset

Returns the unique identifier (UID) of the asset

Returns the URL of the asset

Retrieves the list of tags associated with the asset

Returns the date and time when the asset was created

Returns the user who created the asset

Returns the date and time when the asset was last updated

Returns the user who last updated the asset

Returns the date and time when the asset was deleted

Returns the user who deleted the asset

Returns the full asset object from the API response (all keys and values). The properties above are typed accessors for the main fields in this dictionary.

## AssetLibrary

AssetLibrary class to fetch details of files on Contentstack server.

## setHeader:forKey:

Set a header for AssetLibrary

The header value

The header key

## addHeadersWithDictionary:

Set a header for AssetLibrary

The headers as dictionary which needs to be added to the application.

## removeHeaderForKey:

Removes a header from this AssetLibrary

The header key that needs to be removed.

## sortWithKey:orderBy:

Sorts the assets in the given order on the basis of the specified field.

field uid based on which the ordering should be done.

ascending or descending order in which results should come.

## objectsCount

Provides only the number of assets.

## includeCount

This method also includes the total number of assets returned in the response.

## includeRelativeUrls

This method includes the relative url of assets.

## includeFallback

Retrieve the published content of the fallback locale entry if the entry is not localized in specified locale.

## includeBranch

Retrieve the branch for the published content.

## locale:

This method provides all the assets for the specified language in the response.

Language enum for all language available.

## fetchAll:

This method provides all the assets.

Block to be called once operation is done.

## where:

The where() method retrieves the assets from the stack using any other field UID of the assets.

Field UID of the Asset

The value to match for the field.

property to assign cache policy like CACHE\_THEN\_NETWORK, NETWORK\_ELSE\_CACHE, NETWORK\_ONLY, etc.

## Entry

An initializer is responsible for creating Entry object.

## setHeader:forKey:

Set a header for Entry

The header value

The header key

## addHeadersWithDictionary:

Set a header for Entry

The headers as dictionary which needs to be added to the application.

## removeHeaderForKey:

Removes a header from this Entry.

The header key that needs to be removed.

## configureWithDictionary:

Configure user properties with built object info.

The as dictionary which needs to be added to the application.

## hasKey:

Checks whether an entry has a given property.

The property to be checked

## assetForKey:

Get the info of the specified key of Asset object and returns instance of Assets.

Key containing the reference value of Asset

## assetsForKey:

Get the array containing instance of Assets mentioned in key specified.

Key containing the colection reference value of Assets.

## groupForKey:

Get the info of the specified key of Group object and returns instance of Group.

Key containing the value of Group

## groupsForKey:

Get the info of the specified key of content type and returns array of Group.

Key containing the value of Group array

## HTMLStringForMarkdownKey:

Converts Markdown to String of HTML String for specified key

Key is Multiple Markdown Parameter

## HTMLArrayForMarkdownKey:

Converts Markdown to Array of HTML String for specified key.

Key is Multiple Markdown Parameter

## includeSchema

This method also includes the schema for the entries returned in the response.

## includeContentType

This method also includes the contenttype for the entries returned in the response.

## includeFallback

Retrieve the published content of the fallback locale entry if the entry is not localized in specified locale.

## includeBranch

Retrieve the branch for the published content.

## includeReferenceContentTypeUid

This method also includes the content type UIDs of the referenced entries returned in the response.

## includeEmbeddedItems

Include Embedded Objects (Entries and Assets) along with entry/entries details.

## includeOnlyFields:

Specifies an array of ‘only’ keys in BASE object that would be included in the response.

Array of the ‘only’ keys to be included in response.

## includeAllFieldsExcept:

Specifies an array of keys in reference class object that would be ‘excluded’ from the response.

Array of keys to be excluded from the response.

## includeRefFieldWithKey:

Include reference objects with given key in response.

Array of reference keys to include in response.

## includeRefFieldWithKey:andOnlyRefValuesWithKeys:

Specifies an array of ‘only’ keys in reference class object that would be included in the response.

Key who has reference to some other class object.

Array of the ‘only’ reference keys to be included in response.

## includeRefFieldWithKey:excludingRefValuesWithKeys:

Specifies an array of keys in reference class object that would be ‘excluded’ from the response.

Key who has reference to some other class object.

Array of the ‘only’ reference keys to be ‘excluded’ from the response.

## addParamKey:andValue:

This method adds key and value to an Entry.

The key as string which needs to be added to an Entry

The value as string which needs to be added to an Entry

## fetch:

Fetches an entry asynchronously provided entry UID.

Block to be called once operation is done.

## Variants

The variants method retrieves details of a specific entry variant or an array of entry variants based on the applied query.

Enter the UID of the variant

Readonly property to check value of entry’s uid

Readonly property to check if entry is deleted.

Readonly property to check tags of entry

Readonly property to check ContentType name of entry

Readonly property to check title of entry.

Readonly property to check url of entry.

Readonly property to check Language of entry

Readonly property to check createAt of entry

Readonly property to check createdBy of entry

Readonly property to check updatedAt of entry

Readonly property to check updatedBy of entry

Readonly property to check deletedAt of entry

Readonly property to check deletedBy of entry

The property to assign cache policy like CACHE\_THEN\_NETWORK, NETWORK\_ELSE\_CACHE, NETWORK\_ONLY, etc.

Readonly property to get data of entry.

## Query

An initializer is responsible for creating Query object.

## setHeader:forKey:

Set a header for Query

The header value

The header key

## addHeadersWithDictionary:

Set a header for Query

The headers as dictionary which needs to be added to the application.

## removeHeaderForKey:

Removes a header from this Query.

The header key that needs to be removed.

## locale:

This method provides all the entries for the specified language in the response.

Language enum for all language available.

## tags:

This method provides only the entries that contain tags matching the ones mentioned in the function.

An array of tags that are to be included for the key

## orWithSubqueries:

This method performs the OR operation on the specified query objects and provides only the matching entries.

Array of queries to be taken into consideration.

## andWithSubqueries:

This method performs the AND operation on the specified query objects and provides only the matching entries.

Array of queries to be taken into consideration.

## orderByAscending:

Sorts the provided entries in the ascending order on the basis of the specified field.

The field uid based on which the ordering should be done.

## orderByDescending:

Sorts the provided entries in the descending order on the basis of the specified field.

The field uid based on which the ordering should be done.

## objectsCount

Provides only the number of entries with values matching the specified values for a field.

## includeContentType

This method also includes the contenttype for the entries returned in the response.

## includeFallback

Retrieve the published content of the fallback locale entry if the entry is not localized in specified locale.

## includeBranch

Retrieve the branch for the published content.

## includeReferenceContentTypeUid

This method also includes the content type UIDs of the referenced entries returned in the response.

## includeEmbeddedItems

Include Embedded Objects (Entries and Assets) along with entry/entries details.

## includeCount

This method also includes the total number of entries returned in the response.

## limitObjects:

This method limits the response by providing only the specified number of entries.

Number of entries to be returned

## skipObjects:

This method provide response by skipping only the specified number of entries.

Number of entries to be skipped before returned.

## addQueryWithKey:andValue:

Include custom query using a key and a value.

The name of the key to be added.

The value for the query key.

## addQueryParams:

A custom dictionary can be provided to a query that can specify the conditions for retrieving objects.

A dictionary with all the necessary conditions for retrieving objects.

## removeQueryWithKey:

Removes custom query.

The name of the query.

## whereKey:equalTo:

This method provides only the entries matching the specified value for a field.

Uid of the field that is to be taken into consideration

The value used to match or compare

## whereKey:notEqualTo:

This method provides only the entries with values not equal to the specified value for a field.

Uid of the field that is to be taken into consideration

The value used to match or compare

## whereKey:lessThan:

This method provides only the entries with a values less than the specified value for a field.

Uid of the field that is to be taken into consideration

The value used to match or compare

## whereKey:greaterThan:

This method provides only the entries with values greater than the specified value for a field.

Uid of the field that is to be taken into consideration

The value used to match or compare

## whereKey:lessThanOrEqualTo:

This method provides only the entries with values less than or equal to the specified value for a field.

Uid of the field that is to be taken into consideration

The value used to match or compare

## whereKey:greaterThanOrEqualTo:

This method provides only the entries with values greater than or equal to the specified value for a field.

Uid of the field that is to be taken into consideration

The value used to match or compare

## whereKey:containedIn:

This method provides only the entries with values matching the specified values for a field.

Uid of the field that is to be taken into consideration

An array of values that are to be used to match or compare

## whereKey:notContainedIn:

This method provides only the entries that do not contain values matching the specified values for a field.

Uid of the field that is to be taken into consideration

An array of values that are to be used to match or compare

## whereKeyExists:

This method provides only the entries that contains the field matching the specified field uid.

Uid of the field that is to be taken into consideration

## whereKeyDoesNotExist:

This method provides only the entries that do not contain the field matching the specified field uid.

Uid of the field that is to be taken into consideration

## whereKey:matchesRegex:

This method provides only the entries matching the regular expression for the specified field.

Uid of the field that is to be taken into consideration

The value used to match or compare

## whereKey:matchesRegex:modifiers:

This method provides only the entries matching the regular expression for the specified field.

Uid of the field that is to be taken into consideration

The value used to match or compare

Modifiers for regex options. Specify ‘i’ as the option to ignore the case.

## whereKey:in:

This method provides only the entries matching the Query.

Reference Uid of the field that is to be taken into consideration.

Query to be taken into consideration

## whereKey:notIn:

This method provides only the entries matching the Query.

Reference Uid of the field that is to be taken into consideration.

Query to be taken into consideration

## onlyFields:

This method provides only the entries that match the specified field uids and corresponding values.

An array of values that are to be included for the key

## exceptFields:

This method provides all entries except those that match the specified field uids and corresponding values.

An array of values that are to be included for the key

## includeReferenceFieldWithKey:

This method provides all entries that also contain data from the referred entry in the specified field.

Uid of the reference field that is to be taken into consideration

## includeReferenceFieldWithKey:onlyFields:

This method provides all entries including referred entry containing only specified fields.

Uid of the reference field that is to be taken into consideration

Uid of the reference field that is to be taken into consideration

## includeReferenceFieldWithKey:excludingFields:

This method provides all entries including referred entry containing all fields except specified fields.

Uid of the reference field that is to be taken into consideration

Uid of the reference field that is to be taken into consideration

## addParamKey:andValue:

This method provides all the entries from a specified ContentType.

The key as string which needs to be added to the Query

The value as string which needs to be added to the Query

## find:

This method provides all the entries from a specified ContentType.

**Note:** By default, the limit for response details per request is 100, with the maximum limit set at 250.

Block to be called once operation is done.

## findOne:

This method provides the first entry from a specified ContentType.

Block to be called once operation is done.

The property to assign cache policy like CACHE\_THEN\_NETWORK, NETWORK\_ELSE\_CACHE, NETWORK\_ONLY, etc.

## Taxonomy

[Taxonomy](/docs/developers/taxonomy/about-taxonomy) helps you categorize pieces of content within your stack to facilitate easy navigation and retrieval of information.

## initWithStack

The initWithStack method initializes a new instance of the Taxonomy class using the specified Stack.

The stack instance for making API requests

## query

The querymethod generates a new Query instance for the taxonomy.

## whereKey:equalTo:

The whereKey:equalTo: method adds a condition to filter entries where the specified key matches the provided value.

The key of the field to query for the desired data.

The value to match

## fetch:completion:

The whereKey:equalTo: method adds a condition to filter entries where the specified key matches the provided value.

Optional parameters for the request

Completion handler with result or error

## findTaxonomy:

The findTaxonomy: method executes a query to fetch taxonomy entries that match specified query conditions.

Returns (ResponseType, QueryResult\*, NSError\*)

## orWithSubqueries:

The orWithSubqueries method combines multiple queries using AND condition.

Array of Query objects to combine with OR

## andWithSubqueries:

The andWithSubqueries: method combines multiple queries using AND condition.

Array of Query objects to combine with AND

## Global Fields

A Global field is a reusable field (or group of fields) that you can define once and reuse in any content type within your stack. This eliminates the need (and thereby time and efforts) to create the same set of fields repeatedly in multiple content types.

**Example:**

Stack \*stack = \[Contentstack stackWithAPIKey:@"API\_KEY" accessToken:@"DELIVERY\_TOKEN" environmentName:@"ENVIRONMENT"\];
GlobalField \*globalfield = \[stack globalFieldWithName
:@"Global\_field\_uid"\];
\[globalfield fetch:^(ResponseType type, NSError \* \_Nullable error) {
}\];

## fetch

The fetch method retrieves the details of the specified global field.

UID of the Global field

## find

The find method retrieves the details of all the global fields in the stack.

## includeBranch

The includeBranch method includes the branch details for single or multiple global fields.