From a1f0518d0cd123a791adde64f4f11bd8e44276c7 Mon Sep 17 00:00:00 2001 From: ivar Date: Mon, 20 Oct 2025 00:26:34 +0200 Subject: Initial commit --- .../AccentColor.colorset/Contents.json" | 11 ++++++ .../AppIcon.appiconset/Contents.json" | 35 +++++++++++++++++ .../H\303\246-appen/Assets.xcassets/Contents.json" | 6 +++ "ios/H\303\246-appen/ClusterHit.swift" | 18 +++++++++ "ios/H\303\246-appen/HaeappenApp.swift" | 17 ++++++++ "ios/H\303\246-appen/LocationAuthorizer.swift" | 20 ++++++++++ "ios/H\303\246-appen/MapContentView.swift" | 45 ++++++++++++++++++++++ "ios/H\303\246-appen/PostAnnotationView.swift" | 9 +++++ "ios/H\303\246-appen/TabBarView.swift" | 22 +++++++++++ 9 files changed, 183 insertions(+) create mode 100644 "ios/H\303\246-appen/Assets.xcassets/AccentColor.colorset/Contents.json" create mode 100644 "ios/H\303\246-appen/Assets.xcassets/AppIcon.appiconset/Contents.json" create mode 100644 "ios/H\303\246-appen/Assets.xcassets/Contents.json" create mode 100644 "ios/H\303\246-appen/ClusterHit.swift" create mode 100644 "ios/H\303\246-appen/HaeappenApp.swift" create mode 100644 "ios/H\303\246-appen/LocationAuthorizer.swift" create mode 100644 "ios/H\303\246-appen/MapContentView.swift" create mode 100644 "ios/H\303\246-appen/PostAnnotationView.swift" create mode 100644 "ios/H\303\246-appen/TabBarView.swift" (limited to 'ios/Hæ-appen') diff --git "a/ios/H\303\246-appen/Assets.xcassets/AccentColor.colorset/Contents.json" "b/ios/H\303\246-appen/Assets.xcassets/AccentColor.colorset/Contents.json" new file mode 100644 index 0000000..eb87897 --- /dev/null +++ "b/ios/H\303\246-appen/Assets.xcassets/AccentColor.colorset/Contents.json" @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git "a/ios/H\303\246-appen/Assets.xcassets/AppIcon.appiconset/Contents.json" "b/ios/H\303\246-appen/Assets.xcassets/AppIcon.appiconset/Contents.json" new file mode 100644 index 0000000..2305880 --- /dev/null +++ "b/ios/H\303\246-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\303\246-appen/Assets.xcassets/Contents.json" "b/ios/H\303\246-appen/Assets.xcassets/Contents.json" new file mode 100644 index 0000000..73c0059 --- /dev/null +++ "b/ios/H\303\246-appen/Assets.xcassets/Contents.json" @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git "a/ios/H\303\246-appen/ClusterHit.swift" "b/ios/H\303\246-appen/ClusterHit.swift" new file mode 100644 index 0000000..ebab096 --- /dev/null +++ "b/ios/H\303\246-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\303\246-appen/HaeappenApp.swift" "b/ios/H\303\246-appen/HaeappenApp.swift" new file mode 100644 index 0000000..e8aac4d --- /dev/null +++ "b/ios/H\303\246-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\303\246-appen/LocationAuthorizer.swift" "b/ios/H\303\246-appen/LocationAuthorizer.swift" new file mode 100644 index 0000000..fb6f3c8 --- /dev/null +++ "b/ios/H\303\246-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\303\246-appen/MapContentView.swift" "b/ios/H\303\246-appen/MapContentView.swift" new file mode 100644 index 0000000..4d35dfe --- /dev/null +++ "b/ios/H\303\246-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\303\246-appen/PostAnnotationView.swift" "b/ios/H\303\246-appen/PostAnnotationView.swift" new file mode 100644 index 0000000..024015b --- /dev/null +++ "b/ios/H\303\246-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\303\246-appen/TabBarView.swift" "b/ios/H\303\246-appen/TabBarView.swift" new file mode 100644 index 0000000..ed0a89c --- /dev/null +++ "b/ios/H\303\246-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") + } + } + } +} -- cgit v1.3