Contentstack
Contentstack
Contentstack class that exposes Stack instance
stackWithAPIKey:accessToken:environmentName:
Create a new Stack instance with stack’s API key, Delivery token, and Environment.
| Name | Type | Description |
|---|---|---|
| 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.
| Name | Type | Description |
|---|---|---|
| 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.
| Name | Type | Description |
|---|---|---|
| stack (required) | Stack | Instance of Stack. |
Obj-C
[Contentstack cancelAllRequestsOfStack:stack];
Swift
Contentstack.cancelAllRequestsOfStack(stack)