From c20c1438455dd19eea606683469c3fe4ef4589ab Mon Sep 17 00:00:00 2001 From: Byung jin Date: Tue, 29 Aug 2023 20:12:08 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20::=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=ED=94=BD=EC=BB=A4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Photos/SDPhotoPicker/SDPhotoPickerModifier.swift | 2 ++ .../Sources/Photos/SDPhotoPicker/View + SDPhotoPicker.swift | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/SemicolonDesign/Sources/Photos/SDPhotoPicker/SDPhotoPickerModifier.swift b/SemicolonDesign/Sources/Photos/SDPhotoPicker/SDPhotoPickerModifier.swift index 02f024e3..26742070 100644 --- a/SemicolonDesign/Sources/Photos/SDPhotoPicker/SDPhotoPickerModifier.swift +++ b/SemicolonDesign/Sources/Photos/SDPhotoPicker/SDPhotoPickerModifier.swift @@ -14,12 +14,14 @@ struct SDPhotoPickerModifier: ViewModifier { self.isPresented = isPresented self.singleSelection = selection self.multipleSelection = nil + self.isError = errorAction } init(isPresented: Binding, selection: Binding<[UIImage]>, errorAction: (() -> Void)?) { self.isPresented = isPresented self.singleSelection = nil self.multipleSelection = selection + self.isError = errorAction } func body(content: Content) -> some View { diff --git a/SemicolonDesign/Sources/Photos/SDPhotoPicker/View + SDPhotoPicker.swift b/SemicolonDesign/Sources/Photos/SDPhotoPicker/View + SDPhotoPicker.swift index c3edcc4e..a84ef44d 100644 --- a/SemicolonDesign/Sources/Photos/SDPhotoPicker/View + SDPhotoPicker.swift +++ b/SemicolonDesign/Sources/Photos/SDPhotoPicker/View + SDPhotoPicker.swift @@ -1,14 +1,14 @@ import SwiftUI public extension View { - func sdPhotoPicker(isPresented: Binding, selection: Binding<[UIImage]>, errorAction: (() -> Void)?) -> some View { + func sdPhotoPicker(isPresented: Binding, selection: Binding<[UIImage]>, errorAction: (() -> Void)? = nil) -> some View { self.modifier(SDPhotoPickerModifier( isPresented: isPresented, selection: selection, errorAction: errorAction )) } - func sdPhotoPicker(isPresented: Binding, selection: Binding, errorAction: (() -> Void)?) -> some View { + func sdPhotoPicker(isPresented: Binding, selection: Binding, errorAction: (() -> Void)? = nil) -> some View { self.modifier(SDPhotoPickerModifier( isPresented: isPresented, selection: selection,