Skip to content

Instantly share code, notes, and snippets.

@cardoso
Created May 1, 2020 17:39
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 cardoso/91bd96dcb0d88a2834510d996b4a61b3 to your computer and use it in GitHub Desktop.
Save cardoso/91bd96dcb0d88a2834510d996b4a61b3 to your computer and use it in GitHub Desktop.
import UIKit
import AuthenticationServices
class AuthViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
setupSignInButton()
}
func setupSignInButton() {
let button = ASAuthorizationAppleIDButton()
button.center = view.center
view.addSubview(button)
button.addTarget(self, action: #selector(handleSignInPress), for: .touchUpInside)
}
@objc func handleSignInPress() {
performSegue(withIdentifier: "kAuthToContactsSegueId",
sender: nil)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment