Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // ViewController.swift
- // testProjectforFirebase
- //
- // Created by Jacob Platin on 8/11/16.
- // Copyright © 2016 Jacob Platin. All rights reserved.
- //
- import UIKit
- import Firebase
- class ViewController: UIViewController {
- @IBOutlet weak var profileChangeLabel: UILabel!
- @IBOutlet weak var button: UIButton!
- override func viewDidLoad() {
- super.viewDidLoad()
- // Do any additional setup after loading the view, typically from a nib.
- }
- override func didReceiveMemoryWarning() {
- super.didReceiveMemoryWarning()
- // Dispose of any resources that can be recreated.
- }
- @IBAction func myButton(sender: UIButton) {
- print("BUTTON PRESS")
- FIRAuth.auth()?.signInWithEmail("sam@example.com", password: "sam1234", completion: { (user, error) in
- print(error)
- user?.profileChangeRequest().photoURL = NSURL(string: "Hometown")
- user?.profileChangeRequest().commitChangesWithCompletion({ error in
- print("COMPLETION")
- if let error = error {
- // An error happened.
- print("ERROR")
- print(error)
- } else {
- // Profile updated.
- print("SUCCESS")
- let user = FIRAuth.auth()?.currentUser
- print(user)
- print(user?.email)
- }
- })
- })
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement