Latest 0.1.5
Homepage https://github.com/danielpluvia/DPSideMenu
License MIT
Platforms ios 12.0
Authors

DPSideMenu: Side Menu for Swift

CI Status
Version
License
Platform

Note

The most tricky part is how to store the reference of interactiveTransition and pass it to interactionControllerForDismissal(:) method.

You MUST NOT store a strong reference of presentationController in the UIViewControllerTransitioningDelegate class, or it will cause a problem of retain cycle. Thus, we use a weak reference of interactiveTransition to point to the real interactiveTransition which is stored in presentationController.

Here is the deinit order:

<DPSideMenu.DPSlideInMenuPresentAnimationController: 0x2805103c0>
<DPSideMenu.DPSlideInMenuDismissAnimationController: 0x2805040c0>
<DPSideMenu.DPSlideInMenuPresentationController: 0x153e00b30>
<DPSideMenu.DPSlideInMenuDismissInteractiveTransition: 0x2837338d0>
<DPSideMenu_Example.MenuViewController: 0x153e00600>
<DPSideMenu_Example.ViewController: 0x153900900>
<DPSideMenu.DPSlideInMenuPresentationManager: 0x280529440>

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

DPSideMenu is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'DPSideMenu'

Usage

import DPSideMenu
class ViewController: UIViewController {

lazy var slideInTransitioningDelegate = DPSlideInMenuPresentationManager()

@objc func didTapMenuBtn() {
    let menuController = MenuViewController()
    slideInTransitioningDelegate.direction = .leftToRight
    menuController.transitioningDelegate = slideInTransitioningDelegate
    menuController.modalPresentationStyle = .custom
    present(menuController, animated: true, completion: nil)
}

}

Author

Daniel Ma

License

DPSideMenu is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "DPSideMenu",
    "version": "0.1.5",
    "summary": "This framework is used to create a side menu.",
    "homepage": "https://github.com/danielpluvia/DPSideMenu",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Daniel": "[email protected]"
    },
    "source": {
        "git": "https://github.com/danielpluvia/DPSideMenu.git",
        "tag": "0.1.5"
    },
    "platforms": {
        "ios": "12.0"
    },
    "swift_version": "5",
    "source_files": "DPSideMenu/Classes/**/*"
}

Pin It on Pinterest

Share This