Swiftpack.co - andriyyezerskiy/modalbottomsheet as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by andriyyezerskiy.
andriyyezerskiy/modalbottomsheet 1.0
Adjustable modal bottom sheet, supporting drag, snap and top offset
⭐️ 0
🕓 3 years ago
.package(url: "https://github.com/andriyyezerskiy/modalbottomsheet.git", from: "1.0")

Platform Swift Version PRs Welcome

AYOOModalBottomSheet

A custom modal presentation supporting top offset, snap and drag.

[TOC]


Installation

Swift Package

Adding to project:

File > Swift Packages > Add Package Dependency

https://github.com/andriyyezerskiy/modalbottomsheet

Adding as dependancy to Swift Package:

.package(url: "https://github.com/andriyyezerskiy/modalbottomsheet", from: "1.0.0")

Usage

Implement following extension in the presenting ViewController:

extension MyViewController: UIViewControllerTransitioningDelegate {

    func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? {
        return AYOOModalBottomSheet(presentedViewController: presented, presenting: presenting, blurEffectStyle: .dark)
    }
    
}

Initialise and present modal ViewController:

let viewController = ModalViewController()
viewController.modalPresentationStyle = .custom
viewController.transitioningDelegate = self
self.present(viewController, animated: true)

GitHub

link
Stars: 0
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

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