orderella / popupdialog Goto Github PK
View Code? Open in Web Editor NEWA simple, customizable popup dialog for iOS written in Swift. Replaces UIAlertController alert style.
Home Page: http://www.mwfire.de
License: Other
A simple, customizable popup dialog for iOS written in Swift. Replaces UIAlertController alert style.
Home Page: http://www.mwfire.de
License: Other
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.
Please provide information on your development environment, so we can build with the same scenario.
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.
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
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
Hello,
I am trying to make the UIImage close the popup with a custom vc. Could you tell me how to close the popup without a cancel button?
Regards
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:
This is how I set up my custom view controller in xib file:
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!
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?
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)
Hey,
is it somehow possible to add a textfield to a popup? Would be very great if that somehow works :)
Regards
how can i load a view if im not using storyboard
PopupDialog (~> 0.5)
required by Podfile
None of your spec sources contain a spec satisfying the dependency: PopupDialog (~> 0.5)
.
What does it mean?
有swift2.3 版本的吗?
@mwfire
Can I or How can I apply say a 2pt border around the whole dialogue box?
Its to conform to my UI style
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.
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.
it will show if I set a fix height for the scroll view.
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'
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.
Please provide information on your development environment, so we can build with the same scenario.
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.
I Implement UITableView in Dialog's UIViewController, but when i click to item then tableView: didSelectRowAt indexPath method not invoked.
Please provide information on your development environment, so we can build with the same scenario.
Any eta on switching Swift3.0 branch to Master? Xcode still gives warnings to convert to 3.0 when opening the example project..
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
Hi there,
I want to add an input field to the popup, when prompting the user for input, is this possible?
Cheers
The title speaks for itself: update syntax to Swift 3
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)
@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?😂
I noticed that as the MessagesComposeViewController
is being presented, popup dialogue is pushed to the top left.
It's possible to set custom height for dialog window? thanks
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.
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'
// 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)
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.
Hi ,
I tried The Demo version and also in my app
nothing happened when Uncomment lines in AppDelegate !
Is there something else I should do to enable Dark Mode ?
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.
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() ?
Hope compatibility iOS 8 again
I try make a popup with transparent background but always have white color in the background.
Someone has make this?
Thank you and regards.
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.
Please provide information on your development environment, so we can build with the same scenario.
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.
Created a custom view controller with a table view inside and used at the view controller for the dialog, I had gestures enabled.
I was going to use the table as a picker, when you select a row and handles the selection.
The Tap gesture for dismissal prevents the touches on the cells which prevents the default didSelectRow methods from working
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.
Which one is better? I think first one is simple. 😄
when build, xcode report "dyld: Library not loaded: @rpath/FXBlurView.framework/FXBlurView"
could you remove FXBlurView from dependency?
reproduce step:
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.
Hi, is there a reason why iOS is not supported? :)
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.
Please provide information on your development environment, so we can build with the same scenario.
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.
Use the default popupDialog init function wanting to show a pic that the user had selected from his library in the popup view
I expected the image to resized properly and fit in the popupdialog view (Image Below)
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)
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
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.
ImageView in PopupDialog gets cropped and stretched:
I did some debugging and it looks like this has to do with the contentMode of the UIImageView.
The entire image should have been shown
The image was cropped, and stretched
let popup = PopupDialog(title: "Awesome!", message: "A message here", image: UIImage(named: "test"))
Test graphic: [email protected]:
Is it possible to set somehow the popup view's width?
thanks in advance
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?
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
Currently the popup can be dismissed by tapping anywhere else on the screen, is it possible to disable this?
Thanks for this library - looks great!
Would love to know if it's compatible also with obj-c?
Thanks!
When dialog is active, CPU activity increased to 45% from 3%. CPU usage will only drop after dialog is dismissed
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.