Skip to content

Commit

Permalink
fix: sheets on EmptyViews
Browse files Browse the repository at this point in the history
  • Loading branch information
CemYil03 committed Dec 5, 2021
1 parent f319168 commit 3ecaa8a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Sources/ImagePickerModule/ImagePickerButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,23 +117,23 @@ public struct ImagePickerButton<Content: View, DefaultImageContent: View>: View

).textCase(nil)

EmptyView().sheet(isPresented: self.$showCameraImagePicker) {
Text("").sheet(isPresented: self.$showCameraImagePicker) {

ImagePicker(sourceType: UIImagePickerController.SourceType.camera) { image in
self.selectedImage = image
}.ignoresSafeArea()

}

EmptyView().sheet(isPresented: self.$showLibraryImagePicker) {
Text("").sheet(isPresented: self.$showLibraryImagePicker) {

ImagePicker(sourceType: .photoLibrary) { image in
self.selectedImage = image
}.ignoresSafeArea()

}

EmptyView().sheet(isPresented: self.$showSelectedImage) {
Text("").sheet(isPresented: self.$showSelectedImage) {

if let defaultImageContent = self.defaultImageContent {

Expand Down
4 changes: 2 additions & 2 deletions Sources/ImagePickerModule/ImagesPickerButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ public struct ImagesPickerButton<Content: View>: View {

).textCase(nil)

EmptyView().sheet(isPresented: self.$showCameraImagePicker) {
Text("").sheet(isPresented: self.$showCameraImagePicker) {
ImagePicker(sourceType: UIImagePickerController.SourceType.camera) { image in
self.selectedImages.append(image)
}.ignoresSafeArea()
}

EmptyView().sheet(isPresented: self.$showLibraryImagePicker) {
Text("").sheet(isPresented: self.$showLibraryImagePicker) {
ImagePicker(sourceType: .photoLibrary) { image in
self.selectedImages.append(image)
}.ignoresSafeArea()
Expand Down

0 comments on commit 3ecaa8a

Please sign in to comment.