     }
     
     // MARK: helper methods
-    
-    func presentWebView() {
-        webViewController = IGViewController(delegate: self, callbackUrl: self.igRedirectUri)
-        let viewController :UIViewController = UIApplication.sharedApplication().keyWindow!.rootViewController!
-        viewController.presentViewController(webViewController, animated: true, completion: nil)
-    }
-    
+
     // MARK: IGViewControllerDelegate methods
     
     func success(token: String) {

    }
    
    func applyConstraints() {
        view.addConstraint(NSLayoutConstraint(item: webView, attribute: .Top, relatedBy: .Equal, toItem: self.view, attribute: .Top, multiplier: 1, constant: 0))
        view.addConstraint(NSLayoutConstraint(item: webView, attribute: .Left, relatedBy: .Equal, toItem: self.view, attribute: .Left, multiplier: 1, constant: 0))
        view.addConstraint(NSLayoutConstraint(item: webView, attribute: .Bottom, relatedBy: .Equal, toItem: self.view, attribute: .Bottom, multiplier: 1, constant: 0))
        view.addConstraint(NSLayoutConstraint(item: webView, attribute: .Right, relatedBy: .Equal, toItem: self.view, attribute: .Right, multiplier: 1, constant: 0))

    public func login(fromViewController viewController: UIViewController, success: (user: NSDictionary) -> Void, failure: (error: ErrorType) -> Void) {
        self.successBlock = success
        self.failureBlock = failure
        webViewController = IGViewController(delegate: self, callbackUrl: self.igRedirectUri)
        viewController.presentViewController(webViewController, animated: true, completion: nil)
        let urlStr = "https://api.instagram.com/oauth/authorize/?client_id=\(igAppId!)&redirect_uri=\(igRedirectUri!.stringByAddingPercentEncodingWithAllowedCharacters(.URLHostAllowedCharacterSet())!)&response_type=token&scope=basic"
        let authUrl = NSURL(string: urlStr)!
        webViewController.webView.loadRequest(NSURLRequest(URL: authUrl))
