-
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dd0100d
commit 6f928f6
Showing
7 changed files
with
49 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
Sources/BottomSheet/BottomSheet+ViewModifiers/BottomSheet+Threshold.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// BottomSheet+Threshold.swift | ||
// | ||
// Created by Lucas Zischka. | ||
// Copyright © 2022 Lucas Zischka. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public extension BottomSheet { | ||
|
||
/// Sets a custom threshold which determines, when to trigger swipe to dismiss or flick through. | ||
/// | ||
/// The threshold must be positive and higher than 10% (0.1). | ||
/// Changing the threshold does not affect whether either option is enabled. | ||
/// The default threshold is 30% (0.3) | ||
/// | ||
/// - Parameters: | ||
/// - threshold: The threshold as percentage of the screen height. | ||
/// | ||
/// - Returns: A BottomSheet with a custom threshold. | ||
func customThreshold(_ threshold: Double) -> BottomSheet { | ||
self.configuration.threshold = threshold | ||
return self | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters