I made a ImagePicker
which worked pretty well. But when app get bigger it stops. Does not react to change isPresented
value. As far I know I changed nothing around this part of an App. Also same thing happened in different place, another kind of picker.
print ("HELL'o")
never prints. Silence.
struct ImagePicker: View {
@Binding var imageSource: ImageSource
@State var showFileImporter: Bool = false
@EnvironmentObject var manager: Manager
var body: some View {
VStack {
....
Button(action: {
print("before", showFileImporter)
showFileImporter = true
print("after", showFileImporter)
},
label: { Text("open Image") })
.buttonStyle(.borderless)
.controlSize(.mini)
}.fileImporter(isPresented: $showFileImporter,
allowedContentTypes: [.png, .jpeg, .tiff],
onCompletion: { result in
print ("HELL'o") // Never prints
switch result {
case let .success(url):
guard let _ = try? Data(contentsOf: url) else { return }
....
case let .failure(error):
print(error)
}
})
}
}
Does anybody have an idea what happened? I suspect some settings in completely different palce or bug or computer does not like me.