File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,31 @@ Information about Filtering and the postfixes like 'not_in' can be found [here](
110
110
The rest of the available Endpoints are [ Available Here] ( https://igdb.github.io/api/endpoints/ ) .
111
111
The IGDB API documentation provides [ details on search parameters] ( https://igdb.github.io/api/references/filters/ ) .
112
112
113
+ ## Expander Example
114
+ To use the expander api in structs you have to use the ` expand() ` function
115
+ ``` swift
116
+ var userReviews: [Review] = []
117
+
118
+ let params: Parameters = Parameters ()
119
+ .add (fields : " *" )
120
+ .add (expand : " game" )
121
+ .add (order : " created_at:desc" )
122
+
123
+ wrapper.reviews (params : params, onSuccess : { (reveiewResponse : [Review]) -> (Void ) in
124
+ self .userReviews = reveiewResponse
125
+ }, onError : {(Error ) -> (Void ) in
126
+ // Do something on error
127
+ })
128
+
129
+ let review = userReviews[1 ]
130
+ let expandedGame = review.game ? .expand () // <- Returns the expanded Struct
131
+ print (expandedGame.name )
132
+
133
+ /* The sent request will look like this:
134
+ https://api-2445582011268.apicast.io/reveiws/?fields=*&expand=game&order=created_at:desc */
135
+
136
+ ```
137
+
113
138
## More examples
114
139
``` swift
115
140
You can’t perform that action at this time.
0 commit comments