Skip to content

Instantly share code, notes, and snippets.

@atrinh0
Last active June 10, 2021 09:40
Show Gist options
  • Save atrinh0/3b5806100f257e1a09ec3b246b0a35be to your computer and use it in GitHub Desktop.
Save atrinh0/3b5806100f257e1a09ec3b246b0a35be to your computer and use it in GitHub Desktop.
Pluraliser
import SwiftUI
struct ContentView: View {
let animals = ["bear",
"buffalo",
"cow",
"fish",
"fox",
"goose",
"ox",
"person",
"wolf",
"zebra"]
var body: some View {
NavigationView {
List(animals, id: \.self) { animal in
HStack {
Text("^[\(1) \(animal)](inflect: true)")
Spacer()
Text("^[\(2) \(animal)](inflect: true)")
}
}
.navigationTitle("Pluraliser")
}
}
}
@atrinh0
Copy link
Author

atrinh0 commented Jun 9, 2021

Screenshot 2021-06-09 at 18 01 08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment