ahmad-00 / PanableModal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PanableModal

Add ModalPresentation.swift to your project

Usage

In your source view controller (first view controller) Conform to UIViewControllerTransitioningDelegate and add method below:

func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? {
        ModalPresentation(presentedViewController: presented, presenting: presenting)
}

present destination view controller (second view controller):

let destVC = DestinationVC()
destVC.modalPresentationStyle = .custom
destVC.transitioningDelegate = self
present(destVC, animated: true, completion: nil)

About


Languages

Language:Swift 100.0%