Skip to content

Commit

Permalink
Update ActionSheetCustomViewCard.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmud Ahsan committed May 31, 2021
1 parent 9cc025d commit 105b017
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Sources/ActionSheetCustomViewCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,24 @@ public struct ActionSheetCustomViewCard<Content: View>: View {
let backgroundColor: Color
let outOfFocusOpacity: CGFloat
let minimumDragDistanceToHide: CGFloat
let showFullScreen: Bool

public init(
@ViewBuilder content: ()->Content,
isShowing: Binding<Bool>,
backgroundColor: Color = Color.white,
outOfFocusOpacity: CGFloat = 0.7,
minimumDragDistanceToHide: CGFloat = 150
minimumDragDistanceToHide: CGFloat = 150,
showFullScreen: Bool = false
) {
self.content = content()
_isShowing = isShowing
self.backgroundColor = backgroundColor
self.outOfFocusOpacity = outOfFocusOpacity
self.minimumDragDistanceToHide = minimumDragDistanceToHide
self.showFullScreen = showFullScreen

print(showFullScreen)
}

func hide() {
Expand Down Expand Up @@ -109,12 +114,18 @@ public struct ActionSheetCustomViewCard<Content: View>: View {

var sheetView: some View {
VStack {
Spacer()
if !showFullScreen {
Spacer()
}

VStack (spacing: 14){
topHalfMiddleBar
customView
Text("").frame(height: 20) // empty space

if showFullScreen {
Spacer()
}
}
.background(backgroundColor)
.cornerRadius(10)
Expand Down Expand Up @@ -150,6 +161,7 @@ public struct ActionSheetCustomViewCard<Content: View>: View {
.onReceive(Just(isShowing), perform: { isShowing in
onUpdateIsShowing(isShowing)
})
.edgesIgnoringSafeArea(.all)
}
}

Expand Down

0 comments on commit 105b017

Please sign in to comment.