Contentstack Class Reference

Inherits from NSObject
Declared in Contentstack.h

Intialize Stack

+ stackWithAPIKey:accessToken:environmentName:config:

Create a new Stack instance with stack’s apikey, token, environment name and config.

+ (Stack *)stackWithAPIKey:(NSString *)apiKey accessToken:(NSString *)accessToken environmentName:(NSString *)environmentName config:(Config *)config

Parameters

apiKey

stack apiKey.

accessToken

stack accessToken.

environmentName

environment name in which to perform action.

config

config of stack.

Return Value

new instance of Stack.

Discussion

 //Obj-C
 Config *config = [[Config alloc] init];
 config.host = @"customcontentstack.io";
 Stack *stack = [Contentstack stackWithAPIKey:@"blt5d4sample2633b" accessToken:@"blt3esampletokeneb02" environmentName:@"prod" config:config];

 //Swift
 let config:Config = Config()
 config.host = "customcontentstack.io"
 let stack:Stack = Contentstack.stackWithAPIKey("blt5d4sample2633b",accessToken:"blt3esampletokeneb02", environmentName:@"prod", config:config)

Declared In

Contentstack.h

+ stackWithAPIKey:accessToken:environmentName:

Create a new Stack instance with stack’s apikey, token and environment name.

+ (Stack *)stackWithAPIKey:(NSString *)apiKey accessToken:(NSString *)token environmentName:(NSString *)environmentName

Parameters

apiKey

stack apiKey.

token

accessToken of stack.

environmentName

environment name in which to perform action.

Return Value

new instance of Stack.

Discussion

 //Obj-C
 Stack *stack = [Contentstack stackWithAPIKey:@"blt5d4sample2633b" accessToken:@"blt3esampletokeneb02" environmentName:@"prod"];

 //Swift
 let stack:Stack = Contentstack.stackWithAPIKey("blt5d4sample2633b", accessToken:"blt3esampletokeneb02", environmentName:@"prod")

Declared In

Contentstack.h

+ cancelAllRequestsOfStack:

Cancel all network request for Stack instance.

+ (void)cancelAllRequestsOfStack:(Stack *)stack

Parameters

stack

instance of Stack.

Discussion

 //Obj-C
 [Contentstack cancelAllRequestsOfStack:stack];

 //Swift
 Contentstack.cancelAllRequestsOfStack(stack)

Declared In

Contentstack.h