ContentType Class Reference

Inherits from NSObject
Declared in ContentType.h

Manually set headers

– setHeader:forKey:

Set a header for ContentType

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

Parameters

headerValue

The header key

headerKey

The header value

Discussion

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

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

Declared In

ContentType.h

– addHeadersWithDictionary:

Set a header for ContentType

- (void)addHeadersWithDictionary:(NSDictionary<NSString*,NSString*> *)headers

Parameters

headers

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

Discussion

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

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

Declared In

ContentType.h

– removeHeaderForKey:

Removes a header from this ContentType.

- (void)removeHeaderForKey:(NSString *)headerKey

Parameters

headerKey

The header key that needs to be removed

Discussion

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

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

Declared In

ContentType.h

Entry

– entryWithUID:

Gets the new instance of Entry object with specified UID.

- (Entry *)entryWithUID:(NSString *)uid

Parameters

uid

uid of the Entry object to fetch.

Return Value

new instance of Entry with uid.

Discussion

 //Obj-C
 Entry *entryObj = [contentTypeObj entryWithUID:@"bltf4fsamplec851db"];

 //Swift
 var entryObj:Entry = contentTypeObj.entryWithUID("bltf4fsamplec851db")

Declared In

ContentType.h

Query

– query

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

- (Query *)query

Return Value

Returns new Query instance

Discussion

 //Obj-C
 Query *queryObj = [contentTypeObj query];

 //Swift
 var queryObj:Query = contentTypeObj.query()

Declared In

ContentType.h

ContentType Schema

– fetch:completion:

Gets ContentType Schema defination.

- (void)fetch:(NSDictionary<NSString*,id> *_Nullable)params completion:(void ( ^ ) ( NSDictionary<NSString*,NSString*> *BUILT_NULLABLE_P contentType , NSError *BUILT_NULLABLE_P error ))completionBlock

Parameters

completionBlock

block to be called once operation is done.

Discussion

 //Obj-C

 ContentType * contentType = [stack contentTypeWithName:@"<content_type_id>"]
 [contentType fetch:params completion:^(NSDictionary * _Nullable contentType, NSError * _Nullable error) {

 }];

 //Swift

 let contentType = stack.contentTypeWithName("<content_type_id>")
 contentType.fetch(params, { (contentType, error) in

 })

Declared In

ContentType.h