Swift Package Index



  • The latest stable release is 1.6.0. Released 24 days ago.
  • The last commit to master was 24 days ago.

Swift Version Compatibility

  • 1.6.0 and master
    5.3
    5.2
    5.1
    5.0
    4.2
Full build results

Platform Compatibility

  • 1.6.0 and master
    iOS
    macOS(Intel)
    macOS(ARM)
    Linux
    tvOS
    watchOS
Full build results

NKModalPresenter

NKModalPresenter allows you to present modal view controller easily and beautifully with animation.

Demo Gif

Installation

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

pod 'NKModalPresenter'

Usage

import NKModalPresenter

let viewController = MyViewController()

// Presenting
viewController.presentAsModal()
viewController.presentAsModal(animate: .from(view)) // transition from view
viewController.presentAsModal(animate: .fromTop, to: .center) // customize the animation path

// Modal Controller Configuration
viewController.modalController?.updatePosition(.top) // change position
viewController.modalController?.dismissAnimation = .toBottom // change dismiss animation
viewController.modalController?.tapOutsideToDismiss = true
viewController.modalController?.dragToDismiss = true
viewController.modalController?.avoidKeyboard = true // auto push up when keyboard is visible

// Dismissing
viewController.dismissModal(animated: true, completion: nil)

Examples

Example project provided in Example folder.

Requirements

  • iOS 9+
  • Swift 4.2+