-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCCOJSONManager.h
More file actions
40 lines (30 loc) · 1.12 KB
/
CCOJSONManager.h
File metadata and controls
40 lines (30 loc) · 1.12 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
//
// CCOJSONManager.h
// CCOJSONManagerExample
//
// Created by Chris on 5/14/14.
// Copyright (c) 2014 ChrisCombs. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface CCOJSONManager : NSObject
/**
Singleton instance. Initialization doesn't do much.
*/
+ (CCOJSONManager*)sharedInstance;
/**
Sets the URL to download the JSON from.
Calling this method will also start a new HTTP request. You should really only set this once,
if you change the URL there is no indication if you're retrieving the old data or new data.
@param url The url to access.
*/
- (void)setJSONURL:(NSURL*)url;
/**
Gets the current data that the manager is... managing.
You can call this method as early as you want. The manager uses an operation queue to block
the completion block from firing until the data is downloaded. If the data is already downloaded,
then the queue is open and it executes right away.
@param completion The completion block to fire. It takes one argument, the data that is returned,
by the manager.
*/
- (void)getLeaderboardDataWithCompletionHandler:(void (^)(NSArray *data))completion;
@end