-
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #139 from fermoya/develop
1.12.0 #minor
- Loading branch information
Showing
15 changed files
with
181 additions
and
21 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
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
43 changes: 43 additions & 0 deletions
43
Sources/SwiftUIPager/PageConfiguration/PaginationSensitivity.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,43 @@ | ||
// | ||
// PaginationSensitivity.swift | ||
// SwiftUIPagerExample | ||
// | ||
// Created by Fernando Moya de Rivas on 12/10/2020. | ||
// Copyright © 2020 Fernando Moya de Rivas. All rights reserved. | ||
// | ||
|
||
import CoreGraphics | ||
|
||
/// Defines how sensitive the pagination is to determine whether or not to move to the next the page. | ||
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *) | ||
public enum PaginationSensitivity: Equatable { | ||
|
||
/// The shift relative to container size needs to be greater than or equal to 75% | ||
case low | ||
|
||
/// The shift relative to container size needs to be greater than or equal to 50% | ||
case medium | ||
|
||
/// The shift relative to container size needs to be greater than or equal to 25% | ||
case high | ||
|
||
/// The shift relative to container size needs to be greater than or equal to the specified value | ||
case custom(CGFloat) | ||
|
||
/// The shift relative to container size needs to be greater than or equal to 50% | ||
public static var `default`: Self = .medium | ||
|
||
var value: CGFloat { | ||
switch self { | ||
case .low: | ||
return 0.75 | ||
case .high: | ||
return 0.25 | ||
case .medium: | ||
return 0.5 | ||
case .custom(let value): | ||
return value | ||
} | ||
} | ||
|
||
} |
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
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
Oops, something went wrong.