Created
March 30, 2021 15:32
-
-
Save CrystalKnightCodes/27d1975e23cafc722f12d70d23a3bb0d to your computer and use it in GitHub Desktop.
TabView Tutorial Search Results View Initial Setup
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 SearchResultsView: View { | |
// MARK: - Properties | |
@Binding var results: [Vacation] | |
@Binding var selection: Int | |
// MARK: - View | |
var body: some View { | |
VStack(alignment: .leading) { | |
Text(results.count == 1 ? "1 Result" : "\(results.count) Results") | |
.font(.title2) | |
Divider() | |
if !results.isEmpty { | |
// We'll put the TabView here | |
} else { | |
Text("No current results.") | |
Spacer() | |
} | |
} //: VStack | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment