diff options
| author | ivar <i@oiee.no> | 2025-10-20 23:12:31 +0200 |
|---|---|---|
| committer | ivar <i@oiee.no> | 2025-10-20 23:12:31 +0200 |
| commit | 5c59225ee10949cc58fccce4d968d1ede58be9b6 (patch) | |
| tree | e4f7c77f0069107d83c98453497152d4b01dbe8b /ios/Hæ-appen | |
| parent | 440590ee512f9d4214334d870ca21dc2f39235a2 (diff) | |
| download | what-5c59225ee10949cc58fccce4d968d1ede58be9b6.tar.xz what-5c59225ee10949cc58fccce4d968d1ede58be9b6.zip | |
Change tabs, get started with camera
Diffstat (limited to 'ios/Hæ-appen')
| -rw-r--r-- | ios/Hæ-appen/CameraContentView.swift | 8 | ||||
| -rw-r--r-- | ios/Hæ-appen/CameraManager.swift | 22 | ||||
| -rw-r--r-- | ios/Hæ-appen/MapContentView.swift | 20 | ||||
| -rw-r--r-- | ios/Hæ-appen/TabBarView.swift | 11 |
4 files changed, 40 insertions, 21 deletions
diff --git a/ios/Hæ-appen/CameraContentView.swift b/ios/Hæ-appen/CameraContentView.swift new file mode 100644 index 0000000..0819097 --- /dev/null +++ b/ios/Hæ-appen/CameraContentView.swift @@ -0,0 +1,8 @@ +// +// CameraContentView.swift +// Hæ-appen +// +// Created by Ivar Løvlie on 20/10/2025. +// +import SwiftUI + diff --git a/ios/Hæ-appen/CameraManager.swift b/ios/Hæ-appen/CameraManager.swift new file mode 100644 index 0000000..a2d5d39 --- /dev/null +++ b/ios/Hæ-appen/CameraManager.swift @@ -0,0 +1,22 @@ +// +// CameraManager.swift +// Hæ-appen +// +// Created by Ivar Løvlie on 20/10/2025. +// + +import Foundation +import AVFoundation + +class CameraManager: NSObject { + // 1. + private let captureSession = AVCaptureSession() + // 2. + private var deviceInput: AVCaptureDeviceInput? + // 3. + private var videoOutput: AVCaptureVideoDataOutput? + // 4. + private let systemPreferredCamera = AVCaptureDevice.default(for: .auxiliaryPicture) + // 5. + private var sessionQueue = DispatchQueue(label: "video.preview.session") +} diff --git a/ios/Hæ-appen/MapContentView.swift b/ios/Hæ-appen/MapContentView.swift index 4d35dfe..e77c2b7 100644 --- a/ios/Hæ-appen/MapContentView.swift +++ b/ios/Hæ-appen/MapContentView.swift @@ -14,29 +14,15 @@ struct MapContentView: View { @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 { + } + .task { LocationAuthorizer.shared.requestWhenInUse() } - } + } } diff --git a/ios/Hæ-appen/TabBarView.swift b/ios/Hæ-appen/TabBarView.swift index ed0a89c..aa12188 100644 --- a/ios/Hæ-appen/TabBarView.swift +++ b/ios/Hæ-appen/TabBarView.swift @@ -10,12 +10,15 @@ struct TabBarView : View { var body: some View { if #available(iOS 26, *) { TabView { - Tab("Hææ", systemImage: "house") { + Tab("Hæ", systemImage: "network") { + MapContentView() + } + Tab("Resten", systemImage: "option") { + MapContentView() + } + Tab("", systemImage: "camera.shutter.button.fill", role: .search) { MapContentView() } - } - .tabViewBottomAccessory { - Image(systemName: "person.fill") } } } |
