Giter Site home page Giter Site logo

lsdialogviewcontroller's Introduction

Language: Swift 5.0 License Platform CocoaPodsDL Carthage Compatible

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

LSDialogViewController_animation

Requirement

  • Swift 2+ (Swift 5 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 5.0
pod 'LSDialogViewController', '~> 4.0'

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

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

From Carthage

Add this to Cartfile.

github "daihase/LSDialogViewController"

And then, run this command.

$ carthage update

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.

lsdialogviewcontroller's People

Contributors

daihase avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

lsdialogviewcontroller's Issues

Not displaying view correctly

I'm trying to use the framework however I'm facing a couple of problems with it.

  1. I added the clipsToBounds and layer.cornerRadius to the Key Path of my view. However this doesn't seem to do anything it will just draw a rectangle with no margin in between the view and the superview.

  2. When trying to test the example project this doesn't work since there are a couple of errors. Do you have any idea what might be causing this?

note:
looking at the frameworks inside the pods project the quartz core framework (and the others) are all red

Fatal error, Found nil while unwrapping value

Hi Daisuke, hope you are fine, first of all I thank you for this awesome library, but I am having some issues regarding closing the dialog .. the lines of code below, are the area where app is crashing from file extension of UIViewController+LSDialogViewController.swift.

// close dialog.
func dismissDialogViewController(_ animationPattern: LSAnimationPattern = .fadeInOut) {
let sourceView: UIView = self.getSourceView()
let dialogView: UIView = sourceView.viewWithTag(LSDialogViewTag)!

This is specifically where I am finding nil. kindly help me out I am stuck in here for some long. I need to Complete this app soon. Thank you.

----> let overlayView: UIView = sourceView.viewWithTag(LSOverlayViewTag)!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.