-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathContentstack.m
More file actions
executable file
·46 lines (36 loc) · 1.24 KB
/
Contentstack.m
File metadata and controls
executable file
·46 lines (36 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// Contentstack.m
// Contentstack
//
// Created by Reefaq on 22/06/15.
// Copyright (c) 2015 Contentstack. All rights reserved.
//
#import "Contentstack.h"
#import "CSIOInternalHeaders.h"
#import <Contentstack/Stack.h>
@interface Contentstack ()
@end
@implementation Contentstack
//MARK: - Initialization
+ (Contentstack *)sharedInstance {
static Contentstack *stack = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
stack = [[Contentstack alloc] init];
});
return stack;
}
+ (Stack*)stackWithAPIKey:(NSString*)apiKey accessToken:(NSString*)token environmentName:(NSString*)environmentName;{
Config *config = [[Config alloc] init];
return [Contentstack stackWithAPIKey:apiKey accessToken:token environmentName:environmentName config:config];
}
+ (Stack*)stackWithAPIKey:(NSString*)apiKey accessToken:(NSString *)accessToken environmentName:(NSString*)environmentName config:(Config *)config; {
Stack *stack = [[Stack alloc] initWithAPIKey:apiKey andaccessToken:accessToken andEnvironment:environmentName andConfig:config];
return stack;
}
+ (void)cancelAllRequestsOfStack:(Stack*)stack {
if (stack && stack.network) {
[stack.network cancelAllOperations];
}
}
@end