Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save feighter09/5c6016baee470cadc0793df18551c735 to your computer and use it in GitHub Desktop.
Save feighter09/5c6016baee470cadc0793df18551c735 to your computer and use it in GitHub Desktop.
import Alamofire
import SwiftyJSON
import UIKit
class ViewController: UIViewController {
convenience init() { self.init(nibName: "ViewController", bundle: nil) }
@IBOutlet weak var label: UILabel!
var fetchUser = FetchUser()
override func viewDidLoad()
{
super.viewDidLoad()
fetchUser.perform("feighter09") { (user: User?, error: ErrorType?) in
if let user = user {
self.label.text = "Username: " + user.name
}
else {
self.label.text = "Request failed"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment