Contentstack

View as Markdown

Contentstack

Contentstack class that exposes Stack instance

stackWithAPIKey:accessToken:environmentName:

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

NameTypeDescription
apiKey (required)NSString

Stack API Key.

deliveryToken (required)NSString

Environment specific delivery token.

environment (required)NSString

Stack environment id to fetch content

Obj-C

Stack *stack = [Contentstack stackWithAPIKey:@"API_KEY" accessToken:@"DELIVERY_TOKEN"
environmentName:@"ENVIRONMENT"];

Swift

let stack:Stack = Contentstack.stackWithAPIKey("API_KEY",accessToken:"DELIVERY_TOKEN", environmentName:"ENVIRONMENT")

stackWithAPIKey:accessToken:environmentName:config:

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

NameTypeDescription
apiKey (required)NSString

Stack API Key.

deliveryToken (required)NSString

Environment specific delivery token.

environment (required)NSString

Stack environment id to fetch content

config (required)Config

Config of stack.

Obj-C

Config *config = [[Config alloc] init];

config.host = @"customcontentstack.io";

Stack *stack = [Contentstack stackWithAPIKey:@"API_KEY" accessToken:@"DELIVERY_TOKEN"

environmentName:@"ENVIRONMENT" config:config];

Swift

let config:Config = Config()

config.host = "customcontentstack.io"

let stack:Stack = Contentstack.stackWithAPIKey("API_KEY",accessToken:"DELIVERY_TOKEN", environmentName:"ENVIRONMENT", config:config)

cancelAllRequestsOfStack:

Cancel all network request for Stack instance.

NameTypeDescription
stack (required)Stack

Instance of Stack.

Obj-C

[Contentstack cancelAllRequestsOfStack:stack];

Swift

Contentstack.cancelAllRequestsOfStack(stack)