         GIDSignIn.sharedInstance().scopes.append(contentsOf: [profileScope, emailScope])
         
         loginButton = GIDSignInButton()
+        loginButton.addTarget(self, action: #selector(loginButtonPressed), for: .touchUpInside)
         loginButton.center = view.center
+        view.addSubview(loginButton)
+        
+        loadingActivityIndicator = createLoadingAnimationView()
+        loadingActivityIndicator.center = view.center
+    }
+    
+    func loginButtonPressed() {
+        startLoginAnimation()
+    }
+    
+    func startLoginAnimation() {
+        loginButton.removeFromSuperview()
+        view.addSubview(loadingActivityIndicator)
+        loadingActivityIndicator.startAnimating()
+    }
+    
+    func stopLoginAnimation() {
+        loadingActivityIndicator.stopAnimating()
+        loadingActivityIndicator.removeFromSuperview()
         view.addSubview(loginButton)
     }
     

import SwiftyJSON
import GoogleSignIn
import GGLSignIn

class GoogleLoginViewController: UIViewController, GIDSignInUIDelegate, GIDSignInDelegate {
    
    var loginButton: GIDSignInButton!
    
    override func viewDidLoad() {
        super.viewDidLoad()

        
        guard error == nil else {
            print("\(error.localizedDescription)")
            stopLoginAnimation()
            return
        }
        
