Thanks for your interest in Branch!
The challenge is to build a crash-resistent, and globally accesssible queue (+ extra) for our iOS SDK. Using Objective C, build a queue that holds ServerRequest custom objects (see below for the spec on that).
Some specs:
- The same instance of the queue should be accessible anywhere in the app without passing it as a parameter. For example, the state of the queue to persist throughout the entire life cycle of the application, and be accessible from any View Controller. That means, in View Controller 1, a user could insert a ServerRequest object into the queue. Then in View Controller 2, the user could consume that same ServerRequest object.
- It must be crash/close resistant, and recover queue state in the event of an app crash or app close. That means that any ServerRequests in the queue would still be there on app restart (post crash).
- Stores ServerRequest objects
- Support the functions
- enqueue
- dequeue
- peek
- peek at
- insert at
- remove at
- get size
// ServerRequest.h
@interface ServerRequest : NSObject
@property (strong, nonatomic) NSString *tag;
@property (strong, nonatomic) NSDictionary *postData;
@end
Send [email protected] the .h and .m files for your class.