Skip to content

Commit 30e9c69

Browse files
fix typo in param name and docs
1 parent e1add4f commit 30e9c69

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

Examples/DemosApp/DemosApp/ComponentsPreview/PreviewPages/BottomModalPreview.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ struct BottomModalPreview: View {
6262
footer: self.$contentFooter,
6363
additionalPickers: {
6464
Toggle("Draggable", isOn: self.$model.isDraggable)
65-
Toggle("Hides On Swap", isOn: self.$model.hidesOnSwap)
65+
Toggle("Hides On Swipe", isOn: self.$model.hidesOnSwipe)
6666
}
6767
)
6868
}

Sources/ComponentsKit/Components/Modal/Models/BottomModalVM.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ public struct BottomModalVM: ModalVM {
3131
/// A Boolean value indicating whether the modal should hide when it is swiped down.
3232
///
3333
/// Defaults to `true`.
34-
public var hidesOnSwap: Bool = true
34+
public var hidesOnSwipe: Bool = true
3535

3636
/// A Boolean value indicating whether the modal is draggable.
3737
///
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`.
3940
public var isDraggable: Bool = true
4041

4142
/// The style of the overlay displayed behind the modal.

Sources/ComponentsKit/Components/Modal/Models/CenterModalVM.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ public struct CenterModalVM: ModalVM {
4848
/// Defaults to `.fast`.
4949
public var transition: ModalTransition = .fast
5050

51-
/// Initializes a new instance of `BottomModalVM` with default values.
51+
/// Initializes a new instance of `CenterModalVM` with default values.
5252
public init() {}
5353
}

Sources/ComponentsKit/Components/Modal/SharedHelpers/ModalAnimation.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ enum ModalAnimation {
1010

1111
static func bottomModalOffset(_ translation: CGFloat, model: BottomModalVM) -> CGFloat {
1212
if translation > 0 {
13-
return model.hidesOnSwap
13+
return model.hidesOnSwipe
1414
? translation
1515
: (model.isDraggable ? Self.rubberBandClamp(translation) : 0)
1616
} else {
@@ -26,7 +26,7 @@ enum ModalAnimation {
2626
velocity: CGFloat,
2727
model: BottomModalVM
2828
) -> Bool {
29-
guard model.hidesOnSwap else {
29+
guard model.hidesOnSwipe else {
3030
return false
3131
}
3232

0 commit comments

Comments
 (0)