summaryrefslogtreecommitdiffstats
path: root/ios/Hæ-appen
diff options
context:
space:
mode:
authorivar <i@oiee.no>2025-10-20 00:26:34 +0200
committerivar <i@oiee.no>2025-10-20 00:26:34 +0200
commita1f0518d0cd123a791adde64f4f11bd8e44276c7 (patch)
tree675a7dff8262eea877ec800ff1efe9b92f5d7e7d /ios/Hæ-appen
downloadwhat-a1f0518d0cd123a791adde64f4f11bd8e44276c7.tar.xz
what-a1f0518d0cd123a791adde64f4f11bd8e44276c7.zip
Initial commit
Diffstat (limited to 'ios/Hæ-appen')
-rw-r--r--ios/Hæ-appen/Assets.xcassets/AccentColor.colorset/Contents.json11
-rw-r--r--ios/Hæ-appen/Assets.xcassets/AppIcon.appiconset/Contents.json35
-rw-r--r--ios/Hæ-appen/Assets.xcassets/Contents.json6
-rw-r--r--ios/Hæ-appen/ClusterHit.swift18
-rw-r--r--ios/Hæ-appen/HaeappenApp.swift17
-rw-r--r--ios/Hæ-appen/LocationAuthorizer.swift20
-rw-r--r--ios/Hæ-appen/MapContentView.swift45
-rw-r--r--ios/Hæ-appen/PostAnnotationView.swift9
-rw-r--r--ios/Hæ-appen/TabBarView.swift22
9 files changed, 183 insertions, 0 deletions
diff --git a/ios/Hæ-appen/Assets.xcassets/AccentColor.colorset/Contents.json b/ios/Hæ-appen/Assets.xcassets/AccentColor.colorset/Contents.json
new file mode 100644
index 0000000..eb87897
--- /dev/null
+++ b/ios/Hæ-appen/Assets.xcassets/AccentColor.colorset/Contents.json
@@ -0,0 +1,11 @@
+{
+ "colors" : [
+ {
+ "idiom" : "universal"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/ios/Hæ-appen/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Hæ-appen/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 0000000..2305880
--- /dev/null
+++ b/ios/Hæ-appen/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,35 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "platform" : "ios",
+ "size" : "1024x1024"
+ },
+ {
+ "appearances" : [
+ {
+ "appearance" : "luminosity",
+ "value" : "dark"
+ }
+ ],
+ "idiom" : "universal",
+ "platform" : "ios",
+ "size" : "1024x1024"
+ },
+ {
+ "appearances" : [
+ {
+ "appearance" : "luminosity",
+ "value" : "tinted"
+ }
+ ],
+ "idiom" : "universal",
+ "platform" : "ios",
+ "size" : "1024x1024"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/ios/Hæ-appen/Assets.xcassets/Contents.json b/ios/Hæ-appen/Assets.xcassets/Contents.json
new file mode 100644
index 0000000..73c0059
--- /dev/null
+++ b/ios/Hæ-appen/Assets.xcassets/Contents.json
@@ -0,0 +1,6 @@
+{
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/ios/Hæ-appen/ClusterHit.swift b/ios/Hæ-appen/ClusterHit.swift
new file mode 100644
index 0000000..ebab096
--- /dev/null
+++ b/ios/Hæ-appen/ClusterHit.swift
@@ -0,0 +1,18 @@
+//
+// ClusterHit.swift
+// Hæ-appen
+//
+// Created by Ivar Løvlie on 16/09/2025.
+//
+import GISTools
+import WebKit
+
+struct ClusterHit : Decodable { }
+
+final class ClusterProvider {
+ func load(west:Int, south: Int, north: Int, east: Int) async throws -> [ClusterHit] {
+ let url = URL(string: "http://http://localhost:5281/places?w=\(west)&e=\(east)&s=\(south)&n=\(north)")!
+ let (data, _) = try await URLSession.shared.data(from: url)
+ return try JSONDecoder().decode([ClusterHit].self, from: data)
+ }
+}
diff --git a/ios/Hæ-appen/HaeappenApp.swift b/ios/Hæ-appen/HaeappenApp.swift
new file mode 100644
index 0000000..e8aac4d
--- /dev/null
+++ b/ios/Hæ-appen/HaeappenApp.swift
@@ -0,0 +1,17 @@
+//
+// H__appenApp.swift
+// Hæ-appen
+//
+// Created by Ivar Løvlie on 16/09/2025.
+//
+
+import SwiftUI
+
+@main
+struct HaeappenApp: App {
+ var body: some Scene {
+ WindowGroup {
+ TabBarView()
+ }
+ }
+}
diff --git a/ios/Hæ-appen/LocationAuthorizer.swift b/ios/Hæ-appen/LocationAuthorizer.swift
new file mode 100644
index 0000000..fb6f3c8
--- /dev/null
+++ b/ios/Hæ-appen/LocationAuthorizer.swift
@@ -0,0 +1,20 @@
+//
+// LocationAuthorizer.swift
+// Hæ-appen
+//
+// Created by Ivar Løvlie on 16/10/2025.
+//
+
+import SwiftUI
+import MapKit
+import CoreLocation
+
+final class LocationAuthorizer: NSObject, CLLocationManagerDelegate {
+ static let shared = LocationAuthorizer()
+ private let manager = CLLocationManager()
+
+ func requestWhenInUse() {
+ manager.delegate = self
+ manager.requestWhenInUseAuthorization()
+ }
+}
diff --git a/ios/Hæ-appen/MapContentView.swift b/ios/Hæ-appen/MapContentView.swift
new file mode 100644
index 0000000..4d35dfe
--- /dev/null
+++ b/ios/Hæ-appen/MapContentView.swift
@@ -0,0 +1,45 @@
+//
+// ContentView.swift
+// Hæ-appen
+//
+// Created by Ivar Løvlie on 16/09/2025.
+//
+
+import SwiftUI
+import MapKit
+
+
+struct MapContentView: View {
+ @Namespace var mapScope
+ @State private var position: MapCameraPosition = .automatic
+ var annotationStringKey: LocalizedStringKey = "Annotation"
+ var annotationCoordinate: CLLocationCoordinate2D = CLLocationCoordinate2D.init()
+ let symbolSet: [String] = ["cloud.bolt.rain.fill", "sun.rain.fill", "moon.stars.fill", "moon.fill"]
+
+ var body: some View {
+ if #available(iOS 26, *) {
+ VStack {
+ Map(initialPosition: .userLocation(fallback: position), scope: mapScope)
+ }.safeAreaInset(edge: .trailing) {
+ GlassEffectContainer(spacing: 10.0) {
+ HStack(spacing: 20.0) {
+ ForEach(symbolSet.indices, id: \.self) { item in
+ Image(systemName: symbolSet[item])
+ .frame(width: 80.0, height: 80.0)
+ .font(.system(size: 36))
+ .glassEffect()
+ .glassEffectUnion(id: item < 2 ? "1" : "2", namespace: mapScope)
+ }
+ }
+ }
+ }.mapScope(mapScope)
+ .task {
+ LocationAuthorizer.shared.requestWhenInUse()
+ }
+ }
+ }
+}
+
+#Preview {
+ MapContentView()
+}
diff --git a/ios/Hæ-appen/PostAnnotationView.swift b/ios/Hæ-appen/PostAnnotationView.swift
new file mode 100644
index 0000000..024015b
--- /dev/null
+++ b/ios/Hæ-appen/PostAnnotationView.swift
@@ -0,0 +1,9 @@
+//
+// PostAnnotationView.swift
+// Hæ-appen
+//
+// Created by Ivar Løvlie on 18/10/2025.
+//
+
+import Foundation
+
diff --git a/ios/Hæ-appen/TabBarView.swift b/ios/Hæ-appen/TabBarView.swift
new file mode 100644
index 0000000..ed0a89c
--- /dev/null
+++ b/ios/Hæ-appen/TabBarView.swift
@@ -0,0 +1,22 @@
+//
+// TabBarView.swift
+// Hæ-appen
+//
+// Created by Ivar Løvlie on 19/10/2025.
+//
+import SwiftUI
+
+struct TabBarView : View {
+ var body: some View {
+ if #available(iOS 26, *) {
+ TabView {
+ Tab("Hææ", systemImage: "house") {
+ MapContentView()
+ }
+ }
+ .tabViewBottomAccessory {
+ Image(systemName: "person.fill")
+ }
+ }
+ }
+}