Register
Submit a solution
The challenge is finished.

Challenge Overview

INTRODUCTION
This is one of several challenges to build a Cocoa Touch framework for communicating with the REST services built out in the previous San Antonio challenges. In this challenge we’ll be focusing on extending the framework to include the REST service for notifications.

DETAILED REQUIREMENTS
You’ll be updating the framework and sample project to include the functionality described below.  All code should be written in Swift and utilize ARC.

SARestApi.swift
Add to the existing singleton class used for communicating with the services. The singleton should use NSURLSession and its delegate methods to do service requests.  Network connectivity should be checked before attempting any network communications.  Any errors should be returned as NSError objects.

Add the following methods to the singleton class:

func getNotificationsWithKey(key: NSString, since: NSDate?, delegate: SARestDelegate?)

The “key” value is the value of the EBCKEY stored in the keychain.  This functionality was completed in the first challenge.  The "since" value is the starting date to retrieve notifications.

SARestDelegate.swift

Add the following methods to the existing delegate protocol:

optional func notificationDataReceived(data: NSDictionary)

Successful requests will call this method and return the JSON retrieved from the REST services as a NSDictionary object.

optional func notificationDataFailedWithError(error: NSError)

Failed requests will call this method and return and NSError object with details.

SampleApp

Update the sample project in the repository to implement all methods outlined above. On success display the returned JSON string in a UITextView. On error show a UIAlert with the error code/message.



Final Submission Guidelines

SUBMISSION GUIDELINES
-- Updated Cocoa Touch framework Xcode 6.1 project with well commented code
-- Updated sample Xcode 6.1 project written in Swift using the framework as outlined above
-- Code must compile against iOS SDK 8.1 with a deployment target of iOS 7.0
-- Upload all source projects as a zip
-- Include your gitlab username and URL of your forked repository in your documentation
-- Provide a video overview of your submission

SETUP
-- Send an email to lazybaer or harrywynn and request to be added to the Project Alamo team on gitlab if you are not already a member
-- Once added to the team,
fork the repository if you haven’t already and work off of the JimBowie4 branch
-- Add harrywynn and lazybaer as members of your forked repository.
-- Send an email to lazybaer or harrywynn for an API user email and PIN to request authorization if you do not already have one. Include your Topcoder user name in the request.
-- REST API documentation is located @ http://docs.sanantonionotifications.apiary.io

ELIGIBLE EVENTS:

2015 topcoder Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30047135