Skip to content
This repository has been archived by the owner on May 21, 2023. It is now read-only.

Commit

Permalink
chore: Computed properties for FlickrOAuthViewController
Browse files Browse the repository at this point in the history
Add computed properties for callback and auth url's.
  • Loading branch information
ivan-magda committed Feb 13, 2018
1 parent 67d04c9 commit cfffee2
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions Tagger/FlickrOAuthViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,28 @@ class FlickrOAuthViewController: UIViewController {

private var webView = UIWebView()

private var authorizationURL: String!
private var callbackURL: String!
private var authorizationURLString: String!
private var callbackURLString: String!

private var authorizationURL: NSURL {
get {
return NSURL(string: authorizationURLString)!
}
}
private var callbackURL: NSURL {
get {
return NSURL(string: callbackURLString)!
}
}

private var successBlock: FlickrOAuthViewControllerSuccessCompletionHandler!
private var failureBlock: FlickrOAuthViewControllerFailureCompletionHandler!

// MARK: Init

init(authorizationURL: String, callbackURL: String) {
self.authorizationURL = authorizationURL
self.callbackURL = callbackURL
self.authorizationURLString = authorizationURL
self.callbackURLString = callbackURL
super.init(nibName: nil, bundle: nil)
}

Expand Down Expand Up @@ -89,7 +100,7 @@ class FlickrOAuthViewController: UIViewController {
webView.autoresizingMask = UIViewAutoresizing(arrayLiteral: .FlexibleWidth, .FlexibleHeight)
view.addSubview(webView)

let request = NSURLRequest(URL: NSURL(string: authorizationURL)!)
let request = NSURLRequest(URL: authorizationURL)
webView.loadRequest(request)

let doneBarButtonItem = UIBarButtonItem(barButtonSystemItem: .Done, target: self, action: #selector(dismiss))
Expand Down

0 comments on commit cfffee2

Please sign in to comment.