Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
format code (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
mltbnz authored Aug 8, 2022
1 parent c206b6b commit 19d9104
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion SettingsFeatureApp/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
),
Expand Down
14 changes: 7 additions & 7 deletions WegliKit/Sources/ImagesFeature/CameraView.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import PhotosUI
import SwiftUI
import SharedModels
import SwiftUI

public struct CameraView: UIViewControllerRepresentable {

@Binding var isPresented: Bool
@Binding var pickerResult: [PickerImageResult?]

Expand All @@ -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
}
Expand All @@ -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)
}

Expand Down
3 changes: 2 additions & 1 deletion WegliKit/Sources/ImagesFeature/ImagesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 19d9104

Please sign in to comment.