Skip to content

Instantly share code, notes, and snippets.

@navsing
Created May 14, 2020 22:05
Show Gist options
  • Select an option

  • Save navsing/eb02b7f2bf8bbff1441758ccbd3e4eca to your computer and use it in GitHub Desktop.

Select an option

Save navsing/eb02b7f2bf8bbff1441758ccbd3e4eca to your computer and use it in GitHub Desktop.
struct Login: View {
@ObservedObject var appleView = AppleViewModel()
var body: some View {
VStack {
if appleView.user != nil {
//User Logged In
} else {
Button(action: {
self.appleView.getRequest()
}){
AppleIdButton()
.background(Color.primary).clipShape(RoundedRectangle(cornerRadius: 8, style: .continuous)).padding(7)
.frame(width: UIScreen.main.bounds.width - 100, height: 65)
}
}.onAppear( perform: {
self.appleView.getUserInfo()
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment