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 ContentView: View { | |
// MARK: - Properties | |
@State private var showDetail = false | |
// MARK: - View | |
var body: some View { | |
NavigationView { | |
VStack(spacing: 10) { |
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 | |
import ComposableArchitecture | |
struct HotlistSelector: View | |
{ | |
let store: Store<HotlistManagementState, HotlistManagementAction> | |
var body: some View { | |
WithViewStore(store) { (viewStore: ViewStore<HotlistManagementState, HotlistManagementAction>) in |
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
class RegionModel: ObservableObject | |
{ | |
@Published var region: MKCoordinateRegion | |
init(region: MKCoordinateRegion) | |
{ | |
self.region = region | |
} | |
} |
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) { |
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 ResultCardView: View { | |
// MARK: - Properties | |
var vacation: Vacation | |
// MARK: - View | |
var body: some View { | |
HStack(alignment: .top) { | |
Image(systemName: vacation.imageName) |
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 | |
import MapKit | |
struct SearchMapView: View { | |
// MARK: - Properties | |
@ObservedObject private var regionModel = RegionModel( | |
region: MKCoordinateRegion( | |
center: CLLocationCoordinate2D( | |
latitude: 39.8333, | |
longitude: -98.5833 |
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 SearchBarView: View { | |
//... | |
// MARK: - Methods | |
func findGroup() { | |
results = vacations.all { vacation -> Bool in | |
// First check to see if the text is in the vacation name | |
if vacation.name.localizedCaseInsensitiveContains(text) { | |
return true | |
// If it isn't in the vacation name, search through each place. | |
} else { |
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 SearchBarView: View { | |
// MARK: - Properties | |
@State private var text: String = "" | |
@Binding var results: [Vacation] | |
// MARK: - View | |
var body: some View { | |
VStack(alignment: .leading) { |
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 ContentView: View { | |
// MARK: - Properties | |
@State var results = [Vacation]() | |
@State var selection = 0 | |
// MARK: - View | |
var body: some View { | |
VStack(alignment: .center) { | |
SearchBarView() |
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
// MARK: - Florida | |
// Locations | |
var mysticalKingdom = Place( | |
name: "Mystical Kingdom", | |
latitude: 28.4177, | |
longitude: -81.5812) | |
var aroundTheWorld = Place( | |
name: "Around the World", | |
latitude: 28.3747, |
NewerOlder