Skip to content

Instantly share code, notes, and snippets.

@CrystalKnightCodes
Created March 30, 2021 15:32
Show Gist options
  • Save CrystalKnightCodes/27d1975e23cafc722f12d70d23a3bb0d to your computer and use it in GitHub Desktop.
Save CrystalKnightCodes/27d1975e23cafc722f12d70d23a3bb0d to your computer and use it in GitHub Desktop.
TabView Tutorial Search Results View Initial Setup
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