FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
contentstack-ios/Contentstack/ContentType.h at development · contentstack/contentstack-ios · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
contentstack
/
contentstack-ios
Public
Notifications
You must be signed in to change notification settings
Fork
2
Star
3
Code
Issues
0
Pull requests
1
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
contentstack-ios
/
Contentstack
/
ContentType.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
136 lines (97 loc) · 3.68 KB
Breadcrumbs
contentstack-ios
/
Contentstack
/
ContentType.h
Copy path
File metadata and controls
136 lines (97 loc) · 3.68 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
//
//
ContentType.h
//
Contentstack
//
//
Created by Reefaq on 22/06/15.
//
Copyright (c) 2015 Contentstack. All rights reserved.
//
#
import
<
Foundation/Foundation.h
>
#
import
<
Contentstack/ContentstackDefinitions.h
>
@class
Entry;
@class
Query;
@class
Asset;
BUILT_ASSUME_NONNULL_BEGIN
@interface
ContentType
:
NSObject
- (
instancetype
)
init
UNAVAILABLE_ATTRIBUTE;
//
MARK: - Manually set headers
/*
*---------------------------------------------------------------------------------------
* @name Manually set headers
* ---------------------------------------------------------------------------------------
*/
/*
*
Set a header for ContentType
//Obj-C
[contentTypeObj setHeader:@"MyValue" forKey:@"My-Custom-Header"];
//Swift
contentTypeObj.setHeader("MyValue", forKey: "My-Custom-Header")
@param headerValue The header key
@param headerKey The header value
*/
- (
void
)
setHeader
:
(
NSString
*)
headerValue
forKey
:
(
NSString
*)
headerKey
;
/*
*
Set a header for ContentType
//Obj-C
[contentTypeObj addHeadersWithDictionary:@{@"My-Custom-Header": @"MyValue"}];
//Swift
contentTypeObj.addHeadersWithDictionary(["My-Custom-Header":"MyValue"])
@param headers The headers as dictionary which needs to be added to the application
*/
- (
void
)
addHeadersWithDictionary
:
(
NSDictionary
<NSString *, NSString *> *)
headers
;
/*
*
Removes a header from this ContentType.
//Obj-C
[contentTypeObj removeHeaderForKey:@"My-Custom-Header"];
//Swift
contentTypeObj.removeHeaderForKey("My-Custom-Header")
@param headerKey The header key that needs to be removed
*/
- (
void
)
removeHeaderForKey
:
(
NSString
*)
headerKey
;
//
MARK: - Entry with UID
/*
*---------------------------------------------------------------------------------------
* @name Entry
* ---------------------------------------------------------------------------------------
*/
/*
*
Gets the new instance of Entry object with specified UID.
//Obj-C
Entry *entryObj = [contentTypeObj entryWithUID:@"ENTRY_UID"];
//Swift
var entryObj:Entry = contentTypeObj.entryWithUID("ENTRY_UID")
@param uid uid of the Entry object to fetch.
@return new instance of Entry with uid.
*/
- (Entry*)
entryWithUID
:
(
NSString
*)
uid
;
//
MARK: - Query
/*
*---------------------------------------------------------------------------------------
* @name Query
* ---------------------------------------------------------------------------------------
*/
/*
*
Represents a Query on 'ContentType' which can be executed to retrieve entries that pass the query condition
//Obj-C
Query *queryObj = [contentTypeObj query];
//Swift
var queryObj:Query = contentTypeObj.query()
@return Returns new Query instance
*/
- (Query*)
query
;
//
MARK: - Content-Type Schema
/*
*---------------------------------------------------------------------------------------
* @name ContentType Schema
* ---------------------------------------------------------------------------------------
*/
/*
*
Gets ContentType Schema defination.
//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
})
@param completionBlock block to be called once operation is done.
*/
-(
void
)
fetch
:
(
NSDictionary
<NSString *, id> * _Nullable)
params
completion
:
(
void
(^)(
NSDictionary
<NSString *, NSString *> *
BUILT_NULLABLE_P
contentType,
NSError
*
BUILT_NULLABLE_P
error))
completionBlock
;
@end
BUILT_ASSUME_NONNULL_END
Back
|
FazBrowse Home
|
New Git URL