File tree Expand file tree Collapse file tree 4 files changed +7
-6
lines changed
Examples/DemosApp/DemosApp/ComponentsPreview/PreviewPages
Sources/ComponentsKit/Components/Modal Expand file tree Collapse file tree 4 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ struct BottomModalPreview: View {
62
62
footer: self . $contentFooter,
63
63
additionalPickers: {
64
64
Toggle ( " Draggable " , isOn: self . $model. isDraggable)
65
- Toggle ( " Hides On Swap " , isOn: self . $model. hidesOnSwap )
65
+ Toggle ( " Hides On Swipe " , isOn: self . $model. hidesOnSwipe )
66
66
}
67
67
)
68
68
}
Original file line number Diff line number Diff line change @@ -31,11 +31,12 @@ public struct BottomModalVM: ModalVM {
31
31
/// A Boolean value indicating whether the modal should hide when it is swiped down.
32
32
///
33
33
/// Defaults to `true`.
34
- public var hidesOnSwap : Bool = true
34
+ public var hidesOnSwipe : Bool = true
35
35
36
36
/// A Boolean value indicating whether the modal is draggable.
37
37
///
38
- /// If `true`, the modal can be dragged vertically. Defaults to `true`.
38
+ /// If `true`, the modal can be dragged vertically allowing the user to pull the modal up or down
39
+ /// to interact or dismiss it. Defaults to `true`.
39
40
public var isDraggable : Bool = true
40
41
41
42
/// The style of the overlay displayed behind the modal.
Original file line number Diff line number Diff line change @@ -48,6 +48,6 @@ public struct CenterModalVM: ModalVM {
48
48
/// Defaults to `.fast`.
49
49
public var transition : ModalTransition = . fast
50
50
51
- /// Initializes a new instance of `BottomModalVM ` with default values.
51
+ /// Initializes a new instance of `CenterModalVM ` with default values.
52
52
public init ( ) { }
53
53
}
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ enum ModalAnimation {
10
10
11
11
static func bottomModalOffset( _ translation: CGFloat , model: BottomModalVM ) -> CGFloat {
12
12
if translation > 0 {
13
- return model. hidesOnSwap
13
+ return model. hidesOnSwipe
14
14
? translation
15
15
: ( model. isDraggable ? Self . rubberBandClamp ( translation) : 0 )
16
16
} else {
@@ -26,7 +26,7 @@ enum ModalAnimation {
26
26
velocity: CGFloat ,
27
27
model: BottomModalVM
28
28
) -> Bool {
29
- guard model. hidesOnSwap else {
29
+ guard model. hidesOnSwipe else {
30
30
return false
31
31
}
32
32
You can’t perform that action at this time.
0 commit comments