Skip to content

Instantly share code, notes, and snippets.

@apatronl
Created September 19, 2024 01:20
Show Gist options
  • Save apatronl/9b1a1f76c1939346b82aa762233667e2 to your computer and use it in GitHub Desktop.
Save apatronl/9b1a1f76c1939346b82aa762233667e2 to your computer and use it in GitHub Desktop.
struct ContentView: View {
@State private var showTranslation = false
private var displayedText = quote
static let quote = "Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do."
var body: some View {
VStack {
Spacer()
Text(displayedText)
Spacer()
Button("Translate") {
showTranslation = true
}
}
.padding()
.translationPresentation(
isPresented: $showTranslation,
text: displayedText
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment