Skip to content

Instantly share code, notes, and snippets.

@aataraxiaa
Last active September 4, 2020 10:47
Show Gist options
  • Select an option

  • Save aataraxiaa/2ae91c5a75a5c18fcaffdd80a4e6dbd1 to your computer and use it in GitHub Desktop.

Select an option

Save aataraxiaa/2ae91c5a75a5c18fcaffdd80a4e6dbd1 to your computer and use it in GitHub Desktop.
struct OnboardingButton: View {
// #1
@AppStorage("needsAppOnboarding") var needsAppOnboarding: Bool = true
var body: some View {
GeometryReader { proxy in
LazyHStack {
Button(action: {
// #2
needsAppOnboarding = false
}) {
Text("Finish Setup")
.padding(.horizontal, 40)
.padding(.vertical, 15)
.font(Font.title2.bold().lowercaseSmallCaps())
}
.background(Color.white)
.foregroundColor(.black)
.cornerRadius(40)
.frame(minWidth: 0, maxWidth: proxy.size.width-40)
}
.frame(width: proxy.size.width, height: proxy.size.height/1.5)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment