Stack Class Reference

Inherits from NSObject
Declared in Stack.h

Properties

  apiKey

Readonly property to check value of apikey

@property (nonatomic, copy, readonly) NSString *apiKey

Declared In

Stack.h

  accessToken

Readonly property to check value of access token

@property (nonatomic, copy, readonly) NSString *accessToken

Declared In

Stack.h

  environment

Readonly property to check value of environment provided

@property (nonatomic, copy, readonly) NSString *environment

Declared In

Stack.h

  config

Readonly property to check value of config provided

@property (nonatomic, copy, readonly) Config *config

Declared In

Stack.h

ContentType

– contentTypeWithName:

Gets the new instance of ContentType object with specified name.

- (ContentType *)contentTypeWithName:(NSString *)contentTypeName

Parameters

contentTypeName

name of the contentType to perform action.

Return Value

instance of ContentType.

Discussion

//Obj-C
ContentType *contentTypeObj = [stack contentTypeWithName:@"blog"];

//Swift
var contentTypeObj:ContentType = stack.contentTypeWithName("blog")

Declared In

Stack.h

Manually set headers

– setHeader:forKey:

Set a header for Stack

- (void)setHeader:(NSString *)headerValue forKey:(NSString *)headerKey

Parameters

headerValue

The header key

headerKey

The header value

Discussion

//Obj-C
[stack setHeader:@"MyValue" forKey:@"My-Custom-Header"];

//Swift
stack.setHeader("MyValue", forKey: "My-Custom-Header")

Declared In

Stack.h

– addHeadersWithDictionary:

Set a header for Stack

- (void)addHeadersWithDictionary:(NSDictionary *)headers

Parameters

headers

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

Discussion

//Obj-C
[stack addHeadersWithDictionary:@{@"My-Custom-Header": @"MyValue"}];

//Swift
stack.addHeadersWithDictionary(["My-Custom-Header":"MyValue"])

Declared In

Stack.h

– removeHeaderForKey:

Removes a header from this Stack.

- (void)removeHeaderForKey:(NSString *)headerKey

Parameters

headerKey

The header key that needs to be removed

Discussion

//Obj-C
[stack removeHeaderForKey:@"My-Custom-Header"];

//Swift
stack.removeHeaderForKey("My-Custom-Header")

Declared In

Stack.h

Asset and AssetLibrary

– assetLibrary

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

- (AssetLibrary *)assetLibrary

Return Value

Returns new AssetLibrary instance

Discussion

 //Obj-C
 AssetLibrary *assetLib = [stack assetLibrary];

 //Swift
 var assetLib: AssetLibrary = stack.assetLibrary()

Declared In

Stack.h

– asset

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

- (Asset *)asset

Return Value

Returns new Asset instance

Discussion

 //Obj-C
 Asset *assetObj = [stack asset];

 //Swift
 var assetObj:Asset = stack.asset()

Declared In

Stack.h

– assetWithUID:

Gets the new instance of Asset object with specified UID.

- (Asset *)assetWithUID:(NSString *)uid

Parameters

uid

uid of the Asset object to fetch.

Return Value

new instance of Asset with uid.

Discussion

 //Obj-C
 Asset *assetObj = [contentTypeObj assetWithUID:@"bltf4fsamplec851db"];

 //Swift
 var assetObj:Asset = contentTypeObj.assetWithUID("bltf4fsamplec851db")

Declared In

Stack.h

– imageTransformWithUrl:andParams:

Transforms provided image url based on transformation parameters.

- (NSString *)imageTransformWithUrl:(NSString *)url andParams:(NSDictionary *)params

Parameters

url

Url on which transformations to be applied.

params

Transformation parameters.

Return Value

new instance of transform url.

Discussion

 //Obj-C
 NSDictionary *params = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithInt:100], @"width", [NSNumber numberWithInt:100], @"height", nil];
 NSString *transformedUrl = [stack imageTransformWithUrl:imageURL andParams:params];

 //Swift
 let params:[String : AnyObject?] = [
 "width":100 as AnyObject,
 "height":100 as AnyObject,
 ];
 let transformedUrl:String = stack.imageTransformation(withUrl: imageURL, andParams: params);

Declared In

Stack.h