npu3pak / ios-lib-any-controller-dialog

Show controller as dialog with single line of code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AnyControllerDialog

CI Status Version License Platform

Example

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

Alt Text

Requirements

Swift 3, iOS 8+

Installation

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

pod "AnyControllerDialog", :git => 'https://github.com/npu3pak/ios-lib-any-controller-dialog.git' 

Usage

  1. Import library
import AnyControllerDialog
  1. Instantiate view controller that you want to display as dialog:
let dialogContentController = storyboard?.instantiateViewController(withIdentifier: "DialogContent")
  1. Call showDialog() method of your source view controller:
showDialog(dialogContentController!, height: 200, width: 200, top: 70, completion: {print("Presented!")})

This is extension method added by this library. You can call it from view controllers of any type.

  1. Dismiss controller properly:
dismissDialog(dialogContentController, completion: {print("Dismissed!")})

Author

Евгений Сафронов, evsafronov.personal@yandex.ru

License

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

About

Show controller as dialog with single line of code

License:MIT License


Languages

Language:Swift 85.7%Language:Ruby 14.3%