diff --git a/SettingsFeatureApp/ContentView.swift b/SettingsFeatureApp/ContentView.swift index 7fcd5f00..9bfa79ad 100644 --- a/SettingsFeatureApp/ContentView.swift +++ b/SettingsFeatureApp/ContentView.swift @@ -6,7 +6,7 @@ struct ContentView: View { SettingsView( store: .init( initialState: .init( - accountSettingsState: .init(accountSettings: .init(apiToken: "")), + accountSettingsState: .init(accountSettings: .init(apiToken: "")), contact: .empty, userSettings: .init() ), diff --git a/WegliKit/Sources/ImagesFeature/CameraView.swift b/WegliKit/Sources/ImagesFeature/CameraView.swift index 3c22fb84..1048652a 100644 --- a/WegliKit/Sources/ImagesFeature/CameraView.swift +++ b/WegliKit/Sources/ImagesFeature/CameraView.swift @@ -1,9 +1,8 @@ import PhotosUI -import SwiftUI import SharedModels +import SwiftUI public struct CameraView: UIViewControllerRepresentable { - @Binding var isPresented: Bool @Binding var pickerResult: [PickerImageResult?] @@ -22,20 +21,20 @@ public struct CameraView: UIViewControllerRepresentable { Coordinator(self) } - final public class Coordinator: NSObject, UIImagePickerControllerDelegate, UINavigationControllerDelegate { - + public final class Coordinator: NSObject, UIImagePickerControllerDelegate, UINavigationControllerDelegate { var parent: CameraView init(_ parent: CameraView) { self.parent = parent } - public func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { + public func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any]) { defer { parent.isPresented = false } guard let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage, - let imageData = image.jpegData(compressionQuality: 1) else { + let imageData = image.jpegData(compressionQuality: 1) + else { debugPrint("originalImage info from ImagePickerController could not be casted to UIImage") return } @@ -45,7 +44,8 @@ public struct CameraView: UIViewControllerRepresentable { var coordinate: CoordinateRegion.Coordinate? if let asset: PHAsset = info[UIImagePickerController.InfoKey.phAsset] as? PHAsset, - let imageCoordinate = asset.location?.coordinate { + let imageCoordinate = asset.location?.coordinate + { coordinate = .init(imageCoordinate) } diff --git a/WegliKit/Sources/ImagesFeature/ImagesView.swift b/WegliKit/Sources/ImagesFeature/ImagesView.swift index c52cdece..70783f86 100644 --- a/WegliKit/Sources/ImagesFeature/ImagesView.swift +++ b/WegliKit/Sources/ImagesFeature/ImagesView.swift @@ -98,7 +98,8 @@ public struct ImagesView: View { CameraView( isPresented: viewStore.binding( get: \.showCamera, - send: ImagesViewAction.setShowCamera), + send: ImagesViewAction.setShowCamera + ), pickerResult: viewStore.binding( get: \.storedPhotos, send: ImagesViewAction.setPhotos