This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension MyViewController: UIViewControllerTransitioningDelegate { | |
| func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { | |
| return self | |
| } | |
| func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { | |
| return self | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension MyViewController: UIViewControllerAnimatedTransitioning { | |
| func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { | |
| return 2.0 | |
| } | |
| func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { | |
| // Retrieve the view controllers participating in the current transition from the context. | |
| let fromView = transitionContext.viewController(forKey: .from)!.view! | |
| let toView = transitionContext.viewController(forKey: .to)!.view! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import GoogleSignIn | |
| class AppDelegate: UIResponder, UIApplicationDelegate { | |
| func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
| GIDSignIn.sharedInstance()?.clientID = "769307225775-llbr5f6avrd35u7rpto9p700p2g900qr.apps.googleusercontent.com" | |
| return true | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { | |
| let sourceApplication = options[.sourceApplication] as? String | |
| let annotation = options[.annotation] | |
| return GIDSignIn.sharedInstance()?.handle(url, sourceApplication: sourceApplication, annotation: annotation) ?? false | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension ViewController: GIDSignInDelegate, GIDSignInUIDelegate { | |
| // MARK: - GIDSignInDelegate | |
| func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) { | |
| // A nil error indicates a successful login | |
| googleSignInButton.isHidden = error == nil | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import GoogleSignIn | |
| class ViewController: UIViewController { | |
| // ... | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| /***** Configure Google Sign In *****/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import GoogleSignIn | |
| import GoogleAPIClientForREST | |
| import GTMSessionFetcher | |
| class ViewController: UIViewController { | |
| let googleDriveService = GTLRDriveService() | |
| override func viewDidLoad() { | |
| // ... | |
| GIDSignIn.sharedInstance()?.scopes = [kGTLRAuthScopeDriveFile] |