GithubHelp home page GithubHelp logo

orderella / popupdialog Goto Github PK

View Code? Open in Web Editor NEW
3.9K 3.9K 518.0 177.78 MB

A simple, customizable popup dialog for iOS written in Swift. Replaces UIAlertController alert style.

Home Page: http://www.mwfire.de

License: Other

Ruby 0.69% Swift 99.31%
alert alertview dialog modal overlay popup popup-dialog swift

popupdialog's People

Contributors

0x0c avatar aaronvasquez avatar afnanm1999 avatar aroni avatar audionowdigital avatar gamingwithafnan avatar gonini avatar ivulyov90 avatar maxxfrazer avatar mwfire avatar nyxreloaded avatar petekeller2 avatar readmecritic avatar ryogak avatar salbertson avatar sjrmanning avatar trungp avatar wassupdoc avatar yerkenabildin avatar yoobato avatar ysix 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  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  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

popupdialog's Issues

Programtically close popup from CustomViewController

I am using a custom view to display the popup but can't figure out how to programatically close this from the view controller. I initialise the popup from UINavigationController so cannot reference back the same PopupDialog to use dismiss method.

Is this possible elsewhere?

Custom popupDialog breaks when VC is presented above it

@mwfire
I copied the custom xib from the example and place it in my project. I removed all the stuff in it and replaced it with a tableView displaying my contact list. It works perfectly at this point. When a cell accessory is tapped, I present the MFMessageComposeViewController. When that gets dismissed, my popup dialogue completely breaks. Here are the photos in action sequence.

What could it be?😂

screen shot 2016-09-18 at 11 59 11 pm

screen shot 2016-09-18 at 11 59 38 pm

I noticed that as the MessagesComposeViewController is being presented, popup dialogue is pushed to the top left.
screen shot 2016-09-18 at 11 59 47 pm
screen shot 2016-09-19 at 12 00 04 am

UIStackView has ambiguous layout

Customer View Controller

Here is my controller layout code:

`
let width = (UIScreen.main.bounds.width - 100) / 2

    let height = width * 3 / 4

   self.view.snp.makeConstraints { (make) in
        make.width.equalTo(width)
        make.height.equalTo(height)
    }

    let view = UIView()

    self.view.addSubview(view)
    view.snp.makeConstraints { (make) in
        make.center.equalTo(self.view)
        make.height.width.equalTo(50)
    }

`

then i got .... UIStackView has ambiguous layout

PresentationManager

Parameter of presentationControllerForPresentedViewController(_:presentingViewController:sourceViewController:)' has different optionality than required by protocol 'UIViewControllerTransitioningDelegate'

Initializer does not override a designated initializer from its superclass

Cannot force unwrap value of non-optional type 'UIView'

I´m getting this errors in my project notice that i'm still using this
pod 'PopupDialog', :git => 'https://github.com/Orderella/PopupDialog.git', :tag => '0.4.0'

Custom View Controller

Hi, I may be the only one not being able to replicate the Custom View Controller example from your repository, but when I try to initiate the PopUpDialog with a custom view controller, the custom view does not get created above the buttons, but it seems to be created at the buttons position, ending up with something like the screenshot below:

screen shot 2016-07-25 at 11 18 24 pm

This is how I set up my custom view controller in xib file:

screen shot 2016-07-25 at 11 18 37 pm

I tried to replicate every single step - even the view sizes and constraints - but it just doesn't work as your existing example.

I would appreciate it if you can let me know what I'm missing

Thank you in advance!

Unable to debug

screen shot 2016-08-16 at 12 40 41 am

After installing this pod, I am unable to debug. Any ideas?

Closing the PopUp using custom control on the ViewController

I have a custom view controller which implements a custom button to carry out events. Once these events are complete, I would like to close the popup but I can't find a way of accessing the handleClose method of the PopupDialog (in fact I can't find a away to reference the PopupDialog from within the custom view controller), is there a way to do this without extending the PopupDialog?

The ideal scenario would be the ability to access the PopupDialog functions from the presented view controller.

Customize TransitionAnimator / TransitionAnimations

As of version 0.5.0 the TransitionAnimator subclasses defined in TransitionAnimations are set as final internal classes. The inDuration and outDuration parameters of the TransitionAnimator subclasses are defined in the init method and are hardcoded into the project. The hardcoded values approach prevents configuration of both the inDuration and outDuration parameters. This leaves users of PopupDialog with the choice of either forking the project in order to update the duration properties, or accept the baked in values.

Are there plans to make the TransitionAnimator subclasses configurable?

dismissViewControllerAnimated is not working for custom view controller

I found the solution for this from issue #16, but I think it should be opened again.
I use same code as #16 , but it is a little bit tricky. Also in a Custom View Controller section, you says

Being a subclass of view controller, this can be easily done via dismissViewControllerAnimated(flag: Bool, completion: (() -> Void)?).

I found about two solutions for this.

  1. Use addChildViewController in PopupDialog class & use parentViewController in Subclass ViewController.
  2. Created class for subclassing that has presenter variable. Then assign presenter inside PopupDialog.

Which one is better? I think first one is simple. 😄

High CPU usage

When dialog is active, CPU activity increased to 45% from 3%. CPU usage will only drop after dialog is dismissed

layout issue on iPhone 4 screen

reproduce step:

  1. download example project
  2. change target Devices from "universal" to "iPhone"
  3. run example app
  4. open popup dialogue, you can see it takes too much space
    simulator screen shot 30 nov 2016 4 47 54 pm

question: PopupDialog works well if the app is Universal, but I can't simply convert my iPhone-only app to Universal. Apple rejected my app because they found this issue on iPad devices.

Popup doesn't pop the second time.

Please fill out this template when filing an issue.
All ℹ symbols should be replaced with information on the issue.
Please remove this line and all above before submitting.

Report

Environment

Please provide information on your development environment, so we can build with the same scenario.

  • Mac OS version (e.g. 10.12): 9.3
  • Xcode version (e.g. 8.0): 8
  • PopupDialog version (e.g. 0.5.0): .5
  • Minimum deployment target (e.g. 9.0): 9
  • Language (Objective-C / Swift): Swift
  • In case of Swift - Version (e.g. 3.0): 3

Dependency management

If you are not using any dependency managers, you can remove this section.

Please note: If you are using CocoaPods with Xcode 8, CocoaPods 1.1.0 is required.

  • Dependency manager (e.g. CocoaPods): cocoapods
  • Version (e.g. 1.1.0): 1.1.0

What did you do?

I have a popup for two rows on a static table. The first time I touch, it works, the second time I touch I get a dark screen with no dialog.

To always appear.

A blank dark overlay

Cant get this to work on my project

I have the pod installed, but i can not seem to access anything from the class. Do i have to import anything? Readme is confusing for a first time user.

Custom button height

Is there anyway to customize the button's height, currently the only way around it would be to use custom views that include the buttons, but that is hacky, and defeats the purpose and the flexibility of adding the buttons in the popup dialogue

Swift 3.0 as Master?

Environment

Please provide information on your development environment, so we can build with the same scenario.

  • Mac OS version (e.g. 10.12): 10.12.1
  • Xcode version (e.g. 8.0): 8.0
  • PopupDialog version (e.g. 0.5.0): actuall
  • Minimum deployment target (e.g. 9.0): 10.0
  • Language (Objective-C / Swift): swift
  • In case of Swift - Version (e.g. 3.0): 3.0

Any eta on switching Swift3.0 branch to Master? Xcode still gives warnings to convert to 3.0 when opening the example project..

Disable defaultButton dismiss

Hey. I need that it doesn't dismiss the popUp if textField is empty. So I tried to disable buttonOne.dismissOnTap = false but it does nothing. How should I disable it and manually popUp.dismiss() ?

Popup with transparent background

I try make a popup with transparent background but always have white color in the background.

Someone has make this?

Thank you and regards.

Add input to the popup?

Hi there,

I want to add an input field to the popup, when prompting the user for input, is this possible?

Cheers

Swift 3 issues

I am using the master branch , and it appears that the popup dialog have lost their overlay.
I then configured the pod to use the swift3 branch, however it appeared that the framework was downgraded from 0.3.0 to 0.2.0, and this makes sense because I also lost the functionality of dragging the dialogs.

?Custom Height?

It's possible to set custom height for dialog window? thanks

Button action triggered before animation completes

When using the below code and selecting one of the buttons which triggers a segue, there is a delay moving views. This is possibly due to the PopupDialog not dismissing quick enough.

A dismiss/hide method would be handy for many use cases.

let title = "Account Required"
let message = "Would you like to create an account or sign in?"

 let alert = PopupDialog(title: title, message: message)

let createAccount = DefaultButton(title: "Create Account") {
    self.performSegueWithIdentifier("createAccount", sender: self)
}

let signIn = DefaultButton(title: "Sign In") {         
    self.performSegueWithIdentifier("signIn", sender: self)
 }

let cancel = CancelButton(title: "Cancel") {
     print("Dismiss")
}

alert.addButtons([createAccount, signIn, cancel])

self.presentViewController(alert, animated: true, completion: nil)

Manual Installation

CocoaPods and Carthage are awesome tools and make our life really easier, but there are some devs who still don't know how to use them.

It would be cool to add the Manual installation guide in your README.md. You can take a look at my iOS Readme Template to see how you can do it.

Custom image button

Is there anyway to customize the button using images (icons)?
I could only use custom views to add custom buttons recently, but it seems not so flexible.

Unable to install pod

I have been trying to include the library using cocoapods but it appears that there is an error.

screen shot 2016-06-26 at 11 56 15 am

contentMode for ImageView?

Report

Environment

  • Mac OS version (e.g. 10.12): 10.12
  • Xcode version (e.g. 8.0): 8.0
  • PopupDialog version (e.g. 0.5.0): 0.5.0
  • Minimum deployment target (e.g. 9.0): 9.0
  • Language (Objective-C / Swift): Swift 3
  • In case of Swift - Version (e.g. 3.0): 3.0

Dependency management

  • Dependency manager (e.g. CocoaPods): CocoaPods
  • Version (e.g. 1.1.0): 1.1.0

What did you do?

ImageView in PopupDialog gets cropped and stretched:

14055789_10206167811988826_1992036122_n

I did some debugging and it looks like this has to do with the contentMode of the UIImageView.

What did you expect to happen?

The entire image should have been shown

What happened instead?

The image was cropped, and stretched

Code that demonstrates the issue

let popup = PopupDialog(title: "Awesome!", message: "A message here", image: UIImage(named: "test"))

Test graphic: [email protected]:
confirmemailsenticon 2x

Custom ViewController dismissal isn't working

Hello,

I'm currently faced with an issue where I instantiate a custom view controller as a PopupDialog on a button tap. It's pretty much done the same way as in the example project, but I'm using my own buttons.

This is called in the LoginViewController:

func showRegisterDialog() {
        // Create a custom view controller
        let registerVC = RegisterViewController(nibName: "RegisterViewController", bundle: nil)

        // Create the dialog
        let popup = PopupDialog(viewController: registerVC, transitionStyle: .BounceDown, buttonAlignment: .Horizontal, gestureDismissal: false)

        // Present dialog
        self.presentViewController(popup, animated: true) {
            print("presented")
        }
    }

Now, in the RegisterViewController I want to dismiss the PopupDialog when the user taps on the Cancel button, given by the following:

    @IBAction func cancelRegistration(sender: AnyObject) {
        print("preparing to cancel")        
        self.dismissViewControllerAnimated(true) { 
            print("cancelled")
        }
    }

It prints out the 'preparing to cancel', but never goes into the dismissal... I even tried to use self.presentingViewController?.dismissViewControllerAnimated(true, completion: nil) but presentingViewController returns nil.

Does anyone have a solution to this?

Thanks

PopupDialog does not work with UIViewController that built from storyboard

    // Create a custom view controller
    let editorVC = Storyboards.main.instantiateViewControllerWithIdentifier("TaskEditorViewController")
        as! TaskEditorViewController

    // Create the dialog
    let popup = PopupDialog(viewController: editorVC, transitionStyle: .BounceDown, buttonAlignment: .Horizontal, gestureDismissal: true)

    // Create first button
    let buttonOne = CancelButton(title: "CANCEL") {

    }

    // Create second button
    let buttonTwo = DefaultButton(title: "RATE") {

    }

    // Add buttons to dialog
    popup.addButtons([buttonOne, buttonTwo])

    // Present dialog
    navigationController.presentViewController(popup, animated: true, completion: nil)

here is the result:
simulator screen shot aug 29 2016 7 09 02 pm

Swift 2.3 Compatibility?

Hi! Just wondering, is there a branch or commit where Swift 2.3 support was added? I'm trying to build my app for iOS10 using XCode 8 Beta 6, and so I've got pretty much everything on Swift 2.3 now except for this one. I noticed a Swift3 branch, but didn't see one for Swift 2.3.

These are the errors I'm seeing right now (same errors when I try against the master branch):

- PresentationController.swift:35:14: Initializer does not override a designated initializer from its superclass

- PresentationManager.swift:40:10: Parameter of 'presentationControllerForPresentedViewController(_:presentingViewController:sourceViewController:)' has different optionality than required by protocol 'UIViewControllerTransitioningDelegate'

- TransitionAnimator.swift:54:62: Cannot force unwrap value of non-optional type 'UIView'

iOS 8 support

Hi, is there a reason why iOS is not supported? :)

Using image from the network

Is there a way to use an image from the network? I am thinking perhaps you could somehow expose the reference to ImageView so that it can be used after the async call of loading the image is completed.

tableView: didSelectRowAt indexPath method not invoked

Please fill out this template when filing an issue.
All ℹ symbols should be replaced with information on the issue.
Please remove this line and all above before submitting.

Report

Environment

Please provide information on your development environment, so we can build with the same scenario.

  • Mac OS version (e.g. 10.12): 10.11.5
  • Xcode version (e.g. 8.0): 8.0
  • PopupDialog version (e.g. 0.5.0): 0.5.0
  • Minimum deployment target (e.g. 9.0): 9.0
  • Language (Objective-C / Swift): Swift
  • In case of Swift - Version (e.g. 3.0): 3.0

Dependency management

If you are not using any dependency managers, you can remove this section.

Please note: If you are using CocoaPods with Xcode 8, CocoaPods 1.1.0 is required.

  • Dependency manager (e.g. CocoaPods): CocoaPods
  • Version (e.g. 1.1.0): 1.1.0

What did you do?

I Implement UITableView in Dialog's UIViewController, but when i click to item then tableView: didSelectRowAt indexPath method not invoked.

UITapGesture for dismissal interrupts UITableView cell selection

Please fill out this template when filing an issue.
All ℹ symbols should be replaced with information on the issue.
Please remove this line and all above before submitting.

Report

Environment

Please provide information on your development environment, so we can build with the same scenario.

  • Xcode version (e.g. 8.0): 8.1
  • PopupDialog version (e.g. 0.5.0): 0.5.0
  • Minimum deployment target (e.g. 9.0): 9
  • Language (Objective-C / Swift): Swift
  • In case of Swift - Version (e.g. 3.0): 3.0

Dependency management

If you are not using any dependency managers, you can remove this section.

Please note: If you are using CocoaPods with Xcode 8, CocoaPods 1.1.0 is required.

  • Dependency manager (e.g. CocoaPods): CocoaPods
  • Version (e.g. 1.1.0): 1.1.0

What did you do?

Created a custom view controller with a table view inside and used at the view controller for the dialog, I had gestures enabled.

What did you expect to happen?

I was going to use the table as a picker, when you select a row and handles the selection.

What happened instead?

The Tap gesture for dismissal prevents the touches on the cells which prevents the default didSelectRow methods from working

How could you pass value to popUp?

Hey! I would like to know, how you are able to pass value to popUp vc if you are using customVC. Because if you do like this it doesn't work:

// Create a custom view controller
                    let ratingVC = RatingViewController(nibName: "RatingView", bundle: nil)
                    
                    // Create the dialog
                    let popup = PopupDialog(viewController: ratingVC, buttonAlignment: .horizontal, transitionStyle: .bounceDown, gestureDismissal: true)

ratingVC.selectedProduct = self.products[indexPath.row]
                    
                    
                    
                    // Present dialog
                    self.present(popup, animated: true, completion: nil)

Clang importer creation failed

Environment
MacOSX version 10.12.1 (16B2555)
xCode version Version 8.1 (8B62)
PopupDialog version 5.0
Minimum deployment target 9.0
Language Swift 3.0

Using CocoPods:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Where\'s Hot' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for Where's Hot
  pod 'PopupDialog', '~> 0.5'

end

Report

<unknown>:0: error: invalid virtual filesystem overlay file '/Users/me/Library/Developer/Xcode/DerivedData/Where's_Hot-bxklmcdlmeyvnadlffefxdgnqpti/Build/Intermediates/Pods.build/Debug-iphonesimulator/PopupDialog.build/unextended-module-overlay.yaml'
<unknown>:0: error: clang importer creation failed

This happens only to this library when trying to add it to my project.

Image is oversized

Report

Environment

Please provide information on your development environment, so we can build with the same scenario.

  • Mac OS version (e.g. 10.12): 10.12.3 Beta (16D17a)
  • Xcode version (e.g. 8.0): 8.2 beta (8C30a)
  • PopupDialog version (e.g. 0.5.0): 0.5.1
  • Minimum deployment target (e.g. 9.0): 9.0
  • Language (Objective-C / Swift): Swift
  • In case of Swift - Version (e.g. 3.0): 3.0

Dependency management

If you are not using any dependency managers, you can remove this section.

Please note: If you are using CocoaPods with Xcode 8, CocoaPods 1.1.0 is required.

  • Dependency manager (e.g. CocoaPods): CocoaPods
  • Version (e.g. 1.1.0): 1.1.1

What did you do?

Use the default popupDialog init function wanting to show a pic that the user had selected from his library in the popup view

What did you expect to happen?

I expected the image to resized properly and fit in the popupdialog view (Image Below)
simulator screen shot 27 dec 2016 7 06 19 pm

What happened instead?

Image was way oversized and was even over the screen size and wasn't able to see the full image and the text message (Image Below)
simulator screen shot 27 dec 2016 7 06 30 pm

Is there away i can do it automatically to resize the image or do i have to do it everytime i call this function?

Best regards,
Malcolm

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.