Swiftpack.co - iMinichrispy/UISheetPresentationControllerCustomDetent as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by iMinichrispy.
iMinichrispy/UISheetPresentationControllerCustomDetent 0.9.0
Custom detents in UISheetPresentationController
⭐️ 2
🕓 17 weeks ago
iOS
.package(url: "https://github.com/iMinichrispy/UISheetPresentationControllerCustomDetent.git", from: "0.9.0")

UISheetPresentationControllerCustomDetent

Adds support for specifying custom detents in UISheetPresentationController. Note: This solution relies on a private API, which may break in future iOS releases.

import UISheetPresentationControllerCustomDetent

let viewController = UIViewController()
if let sheetPresentationController = viewController.sheetPresentationController {
    sheetPresentationController.detents = [ .custom(70.0), .custom(200.0), .medium(), .large() ]
    sheetPresentationController.selectedDetentIdentifier = .custom(200.0)
}
present(viewController, animated: true, completion: nil)

License

UISheetPresentationControllerCustomDetent is licensed under the MIT License. See the LICENSE file for more info.

GitHub

link
Stars: 2
Last commit: 17 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics