Created
July 8, 2021 14:51
-
-
Save Toni77777/749b9201c8003ced3b7703db4cc465c3 to your computer and use it in GitHub Desktop.
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
struct ContentView: View { | |
@State var countries: [Country] = [] // Data source | |
var body: some View { | |
if countries.isEmpty { | |
Text("No Countries") // Placeholder | |
.font(.largeTitle) | |
} else { | |
List(countries) { country in // List countires | |
Text(country.name) | |
.font(.title) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment