forcedotcom/SalesforceMobileSDK-iOS — pull request #170 by khawkins (2012-12-03 17:51:18+00:00)
Title: Session timeout capture, OAuth redirect

Points of interest:

- There's a new singleton class—`SFAuthenticationManager`—responsible for most aspects of the OAuth flow. The functionality has been largely cannibalized from `SalesforceOAuthPlugin`, simplifying that plugin's code to only contain the pieces that are relevant to the plugin itself.

- SFAuthenticationManager is also a place where I've started aggregating helper functionality to the OAuth process, some of which used to live in SalesforceOAuthPlugin.

- `SFHybridViewController` has been updated to look for the loading of the page associated with session timeout, heading that off to do authentication in the app, and then redirecting to the original destination of the request.

- I've taken the opportunity to start formalizing some of the functionality we expect to happen in our app delegates, by creating the `SFSDKAppDelegate` protocol inheriting from `UIApplicationDelegate`, which currently only contains the `logout` method. Both native and hybrid app delegates now conform to this protocol.

- TODO: Update the native app delegate to make use of SFAuthenticationManager as well, standardizing the OAuth flow across the native and hybrid layers.

`[SFAuthenticationManager login:completion:failure:]`, and how `SalesforceOAuthPlugin` and `SFHybridViewController` use it, are probably the most interesting changes in this review.