Created
July 6, 2023 01:41
-
-
Save breyed/f262aa0c52bb6368be08083ab417b717 to your computer and use it in GitHub Desktop.
Aaron 18th birthday
This file contains 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 SwiftUI | |
struct ContentView: View { | |
@State private var hex = false | |
@State private var binary = false | |
var body: some View { | |
VStack(spacing: 60) { | |
Text("Happy birthday, Aaron!\n" + "Choose your present.").font(.largeTitle).multilineTextAlignment(.center) | |
HStack { | |
Button(action: { hex = true; binary = false }) { | |
Image(systemName: "birthday.cake").imageScale(.large) | |
} | |
if (hex) { Text("$0x14") } | |
}.font(.title) | |
HStack { | |
Button(action: { hex = false; binary = true }) { | |
Image(systemName: "birthday.cake.fill").imageScale(.large) | |
} | |
if (binary) { Text("$0b101000") } | |
}.font(.title) | |
} | |
.padding() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment