Custom Dialog for iOS written in Swift
Clone or download
Latest commit 36eaec4 Oct 24, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Documents Update README.md Oct 24, 2018
Example Change deployment terget Oct 14, 2018
LSDialogViewController Convert Swift4 into Swift4.2 Oct 14, 2018
.gitignore Update podspec & .gitignore Oct 14, 2018
.travis.yml Fix travis.yml Apr 7, 2018
Gemfile Add Gemfile Oct 14, 2018
Gemfile.lock Add Gemfile Oct 14, 2018
LICENSE Update LICENSE Aug 5, 2016
LSDialogViewController.podspec Update spec Oct 14, 2018
README.md Update README.md Oct 24, 2018

README.md

Build Status Language License Platform CocoaPodsDL

LSDialogViewController is able to easily display a custom view as a dialog.

LSDialogViewController_animation

Requirement

  • Swift 2+ (Swift 4.2 is ready 👍)
  • iOS 8.0+

Installation

From CocoaPods

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

# for Swift 4.2
pod 'LSDialogViewController', '~> 3.0'

# for Swift 3
pod 'LSDialogViewController', '~> 0.1.9'

# for Swift 2
pod 'LSDialogViewController', '0.1.0'

Usage

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

Examples

import LSDialogViewController
// to show the dialog
let dialogViewController: CustomDialogViewController = CustomDialogViewController(nibName:"CustomDialog", bundle: nil)
dialogViewController.delegate = self
self.presentDialogViewController(dialogViewController, animationPattern: animationPattern, completion: { () -> Void in })

// to dismiss the dialog
self.dismissDialogViewController(animationPattern)

Configuration

presentDialogViewController(
  // required
  dialogViewController: :UIViewController,
  // default LSAnimationPattern.FadeInOut
  animationPattern: LSAnimationPattern,
  // default LSDialogBackgroundViewType.Solid
  backgroundViewType: LSDialogBackgroundViewType,
  // default true
  dismissButtonEnabled: Bool,
  // optional
  completion: (() -> Swift.Void)?
)

Other background view type. (.Gradient .None)

Image . Image

License

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