         presentingViewController?.dismissViewControllerAnimated(animated, completion: nil)
     }
     
-}+}

    /// :param: controller
    ///         The controller to present from
    public func authorizeFromController(controller: UIViewController) {
        let web = DropboxConnectController(
            URL: self.authURL(),
            tryIntercept: { url in
                if self.canHandleURL(url) {
                    UIApplication.sharedApplication().openURL(url)
                    return true
                } else {
                    return false
                }
            }
        )
        
        let navigationController = UINavigationController(rootViewController: web)
        controller.presentViewController(navigationController, animated: true, completion: nil)
    }
    
    
    /// Try to handle a redirect back into the application
    ///

    ///         The URL to attempt to handle
    /// :returns: `nil` if SwiftyDropbox cannot handle the redirect URL, otherwise returns the `DropboxAuthResult`.
    public func handleRedirectURL(url: NSURL) -> DropboxAuthResult? {
        
        if !self.canHandleURL(url) {
            return nil
        }
        
        let result : DropboxAuthResult
        if url.host == "1" { // dauth
            result = extractfromDAuthURL(url)
        } else {
            result = extractFromRedirectURL(url)
        }
        
        switch result {
        case .Success(let token):
            Keychain.set(key: token.uid, value: token.accessToken)
            return result
        default:
            return result
        }
    }
    
