Skip to content

Commit 710767c

Browse files
author
Priyanka Mistry
committed
Contentstack framework added
0 parents  commit 710767c

File tree

13 files changed

+1851
-0
lines changed

13 files changed

+1851
-0
lines changed

.gitignore

Whitespace-only changes.

Contentstack.podspec

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Pod::Spec.new do |s|
2+
s.name = 'Contentstack'
3+
s.version = '1.0.1'
4+
s.summary = 'Built.io Contentstack is a headless CMS with an API-first approach that puts content at the centre. It is designed to simplify the process of publication by separating code from content.'
5+
6+
s.description = <<-DESC
7+
Built.io Contentstack is a headless CMS with an API-first approach that puts content at the centre. It is designed to simplify the process of publication by separating code from content.
8+
9+
In a world where content is consumed via countless channels and form factors across mobile, web and IoT, Built.io Contentstack reimagines content management by decoupling code from content. Business users manage content – no training or development required. Developers can create cross-platform apps and take advantage of a headless CMS that delivers content through APIs. With an architecture that’s extensible – but without the bloat of legacy CMS – Built.io Contentstack cuts down on infrastructure, maintenance, cost and complexity.
10+
DESC
11+
12+
s.homepage = 'https://www.built.io/products/contentstack/overview'
13+
s.license = { :type => 'Commercial',:text => 'See https://www.built.io/'}
14+
s.author = { 'Built.io' => 'support@contentstack.io' }
15+
s.source = { :git => 'https://github.com/raweng/BuiltIOContentstack-iOS', :tag => s.version.to_s }
16+
s.social_media_url = 'https://twitter.com/builtio'
17+
18+
s.ios.deployment_target = '7.0'
19+
s.ios.vendored_frameworks = 'SDK/Contentstack.framework'
20+
21+
s.frameworks = 'CoreGraphics', 'MobileCoreServices', 'Security', 'SystemConfiguration'
22+
s.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-lObjC' }
23+
24+
end

Readme.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Contentstack SDK for iOS
2+
Built.io Contentstack is a headless CMS with an API-first approach that puts content at the centre. It is designed to simplify the process of publication by separating code from content. For more information see the [website](https://contentstackdocs.built.io/developer) and [getting started](https://contentstackdocs.built.io/developer).
3+
4+
#### Installation Options
5+
##### Manual
6+
7+
1. Download the [Latest iOS SDK release](https://github.com/raweng/BuiltIOBackend-iOS/releases) and extract the zip file to your local disk.
8+
9+
2. Drag and drop Contentstack.framework into your project folder in Xcode.
10+
11+
A window will appear, prompting you to choose one of the options for adding files. Click the ‘Destination’ checkbox to copy items into the destination group’s folder. This will add the SDK to your project.
12+
13+
3. In the project editor, select your app under `TARGETS`. Under the `General` tab, open `Linked Frameworks and Libraries` and add the following libraries:
14+
- CoreGraphics.framework
15+
- MobileCoreServices.framework
16+
- Security.framework
17+
- SystemConfiguration.framework
18+
19+
4. In your target app, click on the `Build Settings` tab and add the `-ObjC` flag to `Other Linker Flags`.
20+
21+
##### **[CocoaPods](https://cocoapods.org)**
22+
23+
Add the following line to your Podfile:
24+
```sh
25+
pod 'Contentstack'
26+
```
27+
Run `pod install`, and you should now have the latest Contentstack release.
28+
29+
#### Import Header/Module
30+
You can import header file in Objective-C project as:
31+
```sh
32+
#import <Contentstack/Contentstack.h>
33+
```
34+
You can also import as a Module:
35+
36+
```sh
37+
//Objc
38+
@import Contentstack
39+
40+
//Swift
41+
import Contentstack
42+
```
43+
#### Other Links
44+
- [QuickStart](https://contentstackdocs.built.io/developer/ios/quickstart)
45+
- [Developer Guide](https://contentstackdocs.built.io/developer/guides)
46+
- [API Docs](https://contentstackdocs.built.io/ios/api)
47+
48+
## License
49+
```
50+
Copyright (c) 2012-present, Contentstack.io.
51+
All rights reserved.
52+
```
8.94 MB
Binary file not shown.
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
//
2+
// ContentType.h
3+
// Contentstack
4+
//
5+
// Created by Reefaq on 22/06/15.
6+
// Copyright (c) 2015 Built.io. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
#import "ContentstackDefinitions.h"
11+
12+
@class Entry;
13+
@class Query;
14+
15+
BUILT_ASSUME_NONNULL_BEGIN
16+
17+
@interface ContentType : NSObject
18+
19+
- (instancetype)init UNAVAILABLE_ATTRIBUTE;
20+
21+
//MARK: Manually set headers -
22+
/**---------------------------------------------------------------------------------------
23+
* @name Manually set headers
24+
* ---------------------------------------------------------------------------------------
25+
*/
26+
27+
/**
28+
Set a header for ContentType
29+
30+
//Obj-C
31+
[contentTypeObj setHeader:@"MyValue" forKey:@"My-Custom-Header"];
32+
33+
//Swift
34+
contentTypeObj.setHeader("MyValue", forKey: "My-Custom-Header")
35+
36+
@param headerValue The header key
37+
@param headerKey The header value
38+
*/
39+
- (void)setHeader:(NSString *)headerValue forKey:(NSString *)headerKey;
40+
41+
/**
42+
Set a header for ContentType
43+
44+
//Obj-C
45+
[contentTypeObj addHeadersWithDictionary:@{@"My-Custom-Header": @"MyValue"}];
46+
47+
//Swift
48+
contentTypeObj.addHeadersWithDictionary(["My-Custom-Header":"MyValue"])
49+
50+
51+
@param headers The headers as dictionary which needs to be added to the application
52+
*/
53+
- (void)addHeadersWithDictionary:(NSDictionary *)headers;
54+
55+
/**
56+
Removes a header from this ContentType.
57+
58+
//Obj-C
59+
[contentTypeObj removeHeaderForKey:@"My-Custom-Header"];
60+
61+
//Swift
62+
contentTypeObj.removeHeaderForKey("My-Custom-Header")
63+
64+
@param headerKey The header key that needs to be removed
65+
*/
66+
- (void)removeHeaderForKey:(NSString *)headerKey;
67+
68+
//MARK: - Entry with UID -
69+
/**---------------------------------------------------------------------------------------
70+
* @name Entry
71+
* ---------------------------------------------------------------------------------------
72+
*/
73+
74+
/**
75+
Gets the new instance of Entry object with specified UID.
76+
77+
//Obj-C
78+
Entry *entryObj = [contentTypeObj entryWithUID:@"bltf4fsamplec851db"];
79+
80+
//Swift
81+
var entryObj:Entry = contentTypeObj.entryWithUID("bltf4fsamplec851db")
82+
83+
84+
@param uid uid of the Entry object to fetch.
85+
@return new instance of Entry with uid.
86+
*/
87+
- (Entry*)entryWithUID:(NSString*)uid;
88+
89+
//MARK: - Query -
90+
/**---------------------------------------------------------------------------------------
91+
* @name Query
92+
* ---------------------------------------------------------------------------------------
93+
*/
94+
95+
/**
96+
Represents a Query on 'ContentType' which can be executed to retrieve entries that pass the query condition
97+
98+
//Obj-C
99+
Query *queryObj = [contentTypeObj query];
100+
101+
//Swift
102+
var queryObj:Query = contentTypeObj.query()
103+
104+
@return Returns new Query instance
105+
*/
106+
- (Query*)query;
107+
108+
@end
109+
110+
BUILT_ASSUME_NONNULL_END
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
//
2+
// Contentstack.h
3+
// Contentstack
4+
//
5+
// Created by Reefaq on 22/06/15.
6+
// Copyright (c) 2015 Built.io. All rights reserved.
7+
//
8+
9+
// sdk-version: 1.0.1
10+
11+
#import <Foundation/Foundation.h>
12+
13+
#import <Contentstack/Stack.h>
14+
#import <Contentstack/ContentType.h>
15+
#import <Contentstack/Entry.h>
16+
#import <Contentstack/Query.h>
17+
#import <Contentstack/QueryResult.h>
18+
19+
@class Stack;
20+
21+
BUILT_ASSUME_NONNULL_BEGIN
22+
23+
@interface Contentstack : NSObject
24+
25+
- (instancetype)init UNAVAILABLE_ATTRIBUTE;
26+
/**
27+
Create a new Stack instance with stack's apikey, token and environment name.
28+
29+
//Obj-C
30+
Stack *stack = [Contentstack stackWithAPIKey:@"blt5d4sample2633b" accessToken:@"blt3esampletokeneb02" environmentName:@"dummy"];
31+
32+
//Swift
33+
let stack:Stack = Contentstack.stackWithAPIKey("blt5d4sample2633b", accessToken:"blt3esampletokeneb02", environmentName:@"dummy")
34+
35+
@param apiKey stack apiKey.
36+
@param token acesstoken of stack.
37+
@param environmentName environment name in which to perform action.
38+
39+
@return new instance of Stack.
40+
*/
41+
+ (Stack*)stackWithAPIKey:(NSString*)apiKey accessToken:(NSString*)token environmentName:(NSString*)environmentName;
42+
43+
/**
44+
Create a new Stack instance with stack's apikey, token and environment name.
45+
46+
//Obj-C
47+
Stack *stack = [Contentstack stackWithAPIKey:@"blt5d4sample2633b" accessToken:@"blt3esampletokeneb02" environmentUID:@"dummyUID"];
48+
49+
//Swift
50+
let stack:Stack = Contentstack.stackWithAPIKey("blt5d4sample2633b", accessToken:"blt3esampletokeneb02", environmentUID:@"dummyUID")
51+
52+
53+
@param apiKey stack apiKey.
54+
@param token acesstoken of stack.
55+
@param environmentUID environment uid in which to perform action.
56+
57+
@return new instance of Stack.
58+
*/
59+
+ (Stack*)stackWithAPIKey:(NSString*)apiKey accessToken:(NSString*)token environmentUID:(NSString*)environmentUID;
60+
61+
/**
62+
Cancel all network request for Stack instance.
63+
64+
//Obj-C
65+
[Contentstack cancelAllRequestsOfStack:stack];
66+
67+
//Swift
68+
Contentstack.cancelAllRequestsOfStack(stack)
69+
70+
@param stack instance of Stack.
71+
*/
72+
+ (void)cancelAllRequestsOfStack:(Stack*)stack;
73+
74+
@end
75+
76+
BUILT_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)