Skip to content

Commit

Permalink
Merge pull request #41 from edequartel/version-20
Browse files Browse the repository at this point in the history
Version 20
  • Loading branch information
edequartel authored Apr 5, 2024
2 parents f0c3f54 + 9fbf58c commit e0edfb7
Show file tree
Hide file tree
Showing 33 changed files with 2,776 additions and 940 deletions.
58 changes: 25 additions & 33 deletions Ravens.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@
filePath = "Ravens/Views/MapObservationsLocationView.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "87"
endingLineNumber = "87"
startingLineNumber = "83"
endingLineNumber = "83"
landmarkName = "body"
landmarkType = "24">
</BreakpointContent>
Expand All @@ -132,21 +132,5 @@
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "D88A85B1-2540-4541-B526-E3D5C3B4DDC8"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Ravens/Views/MapObservationsLocationView.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "211"
endingLineNumber = "211"
landmarkName = "body"
landmarkType = "24">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
103 changes: 39 additions & 64 deletions Ravens/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,85 +18,38 @@ struct ContentView: View {
@StateObject private var observationsViewModel = ObservationsViewModel(settings: Settings())
@StateObject private var observationsSpeciesViewModel = ObservationsSpeciesViewModel(settings: Settings())

@State private var isSheetObservationsViewPresented = false
@State private var isSheetObservationsLocationsViewPresented = false

@State private var locationId: Int?

var body: some View {
TabView {
// Tab 0
// LottieView(lottieFile: "LottieFile")
// .tabItem {
// Text("Lottie")
// Image(systemName: "globe")
// }

// Tab 0
// AudioView()
// .tabItem {
// Text("weather")
// Image(systemName: "globe")
// }
// Tab 0
// LookUpsView()
// .tabItem {
// Text("weather")
// Image(systemName: "globe")
// }
// Tab 0
// LocationLatLongView()
// .tabItem {
// Text("weather")
// Image(systemName: "globe")
// }
// Tab 0
// POIsView()
// .tabItem {
// Text("weather")
// Image(systemName: "globe")
// }

// Tab 1
ZStack {
MapObservationView()
ObservationCircle(toggle: $isSheetObservationsViewPresented, colorHex: "f7b731")
}
MapObservationView()
.tabItem {
Text("Radius")
Image(systemName: "circle")
}

// Tab 2
ZStack {
MapObservationsLocationView(sharedLocationId: Binding<Int>(get: { self.locationId ?? 0 }, set: { self.locationId = $0 }))
ObservationCircle(toggle: $isSheetObservationsLocationsViewPresented, colorHex: "a7b731")
}
MapObservationsLocationView()
.tabItem {
Text("Area")
Image(systemName: "pentagon")
}

// Tab 2
BirdView()
SpeciesView()
.tabItem {
Text("Species")
Image(systemName: "tree")
}

// Tab 3
// Tab 4
MapObservationsUserView()
.tabItem {
Text("We")
Image(systemName: "person.2.fill")
Text("Me")
Image(systemName: "person.fill")
}

// // Tab 4
// EmptyView()
// .tabItem {
// Text("Explorers")
// Image(systemName: "person.2.fill")
// }


// Tab 5
SettingsView()
Expand All @@ -105,16 +58,6 @@ struct ContentView: View {
Image(systemName: "gearshape")
}
}

.sheet(isPresented: $isSheetObservationsViewPresented) {
ObservationsView(isShowing: $isSheetObservationsViewPresented)
}
.sheet(isPresented: $isSheetObservationsLocationsViewPresented) {
ObservationsLocationView(
locationId: Binding<Int>(get: { self.locationId ?? 0 }, set: { self.locationId = $0 }),
// locationStr: <#T##Binding<String>#>(get: { self.locationId ?? 0 }, set: { self.locationId = $0 }),
isShowing: $isSheetObservationsLocationsViewPresented)
}
.onAppear() {
log.warning("*** NEW LAUNCH ***")
CLLocationManager().requestWhenInUseAuthorization()
Expand Down Expand Up @@ -176,4 +119,36 @@ struct ContentView_Previews: PreviewProvider {
// Text("Book")
// Image(systemName: "book")
// }

//Tab 0
// LottieView(lottieFile: "LottieFile")
// .tabItem {
// Text("Lottie")
// Image(systemName: "globe")
// }
//
// Tab 0
// AudioView()
// .tabItem {
// Text("weather")
// Image(systemName: "globe")
// }
// Tab 0
// LookUpsView()
// .tabItem {
// Text("weather")
// Image(systemName: "globe")
// }
// Tab 0
// LocationLatLongView()
// .tabItem {
// Text("weather")
// Image(systemName: "globe")
// }
// Tab 0
// POIsView()
// .tabItem {
// Text("weather")
// Image(systemName: "globe")
// }

41 changes: 0 additions & 41 deletions Ravens/Data/Obs.swift

This file was deleted.

105 changes: 86 additions & 19 deletions Ravens/Data/Observations.swift
Original file line number Diff line number Diff line change
@@ -1,42 +1,109 @@
// This file was generated from JSON Schema using quicktype, do not modify it directly.
// This file was generated from JSON Schema using quicktype, do not modify it directly.
// To parse the JSON, add this file to your project and do:
//
// Observation.swift
// Ravens
//
// Created by Eric de Quartel on 11/01/2024.
//
// var observationsSpecies = try? JSONDecoder().decode(ObservationsSpecies.self, from: jsonData)

import Foundation

// MARK: - Observation
// MARK: - Observations //
struct Observations: Codable {
var count: Int?
var next, previous: URL?
var results: [Observation]
}

// MARK: - Result
struct Observation: Codable, Identifiable {
var id: Int = 0
var permalink: String = ""
var date: String = ""
var time: String? = "11:00"
var species_detail: SpeciesDetail
var id: Int?
var species: Int?
var date: String = "2023-01-01"
var time: String?
var number: Int = 0
var sex: String = ""
var point: Point
var accuracy: Int?
var notes: String?
var is_certain: Bool = false
var is_escape: Bool = false
var activity: Int = 0
var life_stage: Int = 0
var method: Int = 0
var has_photo: Bool = true
var has_sound: Bool = true
var point: Point
var location_detail: LocationDetail
var method: Int?
var substrate: Int?
var related_species: Int?
var obscurity: Int?
var has_photo: Bool?
var has_sound: Bool?
var counting_method: Int?
var embargo_date: String?
var uuid: String?
let externalReference: [String]?
// var links: [String?]
// var details: [String?]
var observer_location: Point?
var transect_uuid: URL?
var species_detail: SpeciesDetail
var rarity: Int = 0
var is_certain: Bool = true
var is_escape: Bool = true
var validation_status: String = ""
var user: Int = 0
var user_detail: UserDetail?
var modified: String?
var species_group: Int?
var validation_status: String = ""
var location: Int?
var location_detail: LocationDetail?
var photos: [String]?
var sounds: [String]?
var permalink: String = ""

var detail: String?
var code: String?
}

// MARK: - UserDetail
struct UserDetail: Codable {
var id: Int = 0
var name: String = ""
var avatar: URL?
}

// MARK: - Obs
//struct Obs: Codable, Identifiable {
// let accuracy: Int?
// let activity, lifeStage: Int?
// let code: String?
// let counting_method: Int?
// let date: String
// let detail: String?
// let embargo_date: String?
// let externalReference: String?
// let is_certain, is_escape: Bool?
// var id: Int
// let location: Int?
// let location_detail: LocationDetail?
// let method: Int?
// let modified: String?
// var number: Int
// let notes: String?
// let obscurity, related_species, substrate: Int?
// let permalink: String
// let photos: [String]
// let point: Point
// let rarity, user: Int?
// let sex: String
// var species: Int = 0
// let species_detail: SpeciesDetail
// let species_group: Int?
// let sounds: [String]
// var time: String?
// let transectUUID: String?
// let user_detail: UserDetail?
// let uuid: String?
// let validation_status: String?
// // let links, details: [String]
// // let observer_location: String? is a geoJSON
//}


struct SpeciesDetail: Codable {
var id: Int = 0
var scientific_name: String = ""
Expand Down
Loading

0 comments on commit e0edfb7

Please sign in to comment.