regexident / dlalertview Goto Github PK
View Code? Open in Web Editor NEWUIAlertView replacement that can embed custom content views, is fully themable and let's you use a delegate and/or blocks.
License: Other
UIAlertView replacement that can embed custom content views, is fully themable and let's you use a delegate and/or blocks.
License: Other
please help to achieve this
I have tableView as a contentView and in the bottom row I have textView
Hi,
I am trying to show an AlertView B
right after another one (A
) has been closed, from A
's completion block. This shows B
for a very short time before it disappears. I guess this is a limitation of the implementation but maybe there is a quick fix.
Hello!
I'm using DLAVAlertView in my project, but I want to dismiss It programmatically.
How can I dismiss this alert?
Thanks ๐
Hi, great project, I'm using it in a project now where I need to customise an alert.
Just a note - you have made this as close as possible to the UIAlertView API, but there's a few display inconsistencies.
The following example shows how the first other button is bolded in UIKit.
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert"
message:nil
delegate:nil
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Done", nil];
Whereas in DLAlertView
DLAVAlertView *alertView = [[DLAVAlertView alloc] initWithTitle:@"Alert"
message:nil
delegate:nil
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Done", nil];
[alertView show];
Also the Cancel button shows at the bottom (bolded) in UIKit, and the top in DLAlertView.
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert"
message:nil
delegate:nil
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"One", @"Two", nil];
[alert show];
DLAVAlertView *alertView = [[DLAVAlertView alloc] initWithTitle:@"Alert"
message:nil
delegate:nil
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"One", @"Two", nil];
[alertView show];
Is this an oversight? Thanks
Hi. I really like DLAlertView and I want to use it within my app.
But the fact is that its deployment target is 7.0+ so that I cannot integrate it with my app.
I have checked that it works on 6.0 without any problems.
So could you make your library's deployment target to 6.0+ and modify podspec accordingly?
Thanks!
On show the first textfield is set as first responder and the keyboard appears. In cases where the alert has multiple buttons it may hide the last one: adding a setting to disable the behaviour and let the user bring the keyboard up would be very nice.
When the user clicks the return key of the keyboard the first other button is clicked. Please add the ability to change the index of the button that is clicked or to disable the behaviour. Keep the first other button index or the behaviour enabled as default.
Last one: changing the button the delegate can disable on bad input, this is not always the first other button.
Thanks :)
With the latest commit, the title label doesn't seem to be showing in the alert. I've tried a number of combinations, and it still won't appear.
Please add ability to display content in the top above title and message
If I set the cancel title to nil:
DLAVAlertView *alertView = [[DLAVAlertView alloc] initWithTitle:@"title"
message:@"message"
delegate:nil
cancelButtonTitle:nil
otherButtonTitles:@"button1", @"button2", nil];
the firstOtherButtonIndex
always is 1:
- (NSInteger)firstOtherButtonIndex {
if (self.buttons.count == 1) {
return (self.cancelButtonIndex == -1) ? 0 : -1;
}
return 1;
}
But It should be 0, because the cancel button is not require and the firstOtherButtonIndex should be 0!
I not found it support blocks! I just callback by the delegate.
Hello, first of all, great work!
Will you add the 1.1 version to the pod?
Can't make big customisation with 1.0 version...
thx
So when I run the demo project in Xcode 6 GM, the AlertView freezes after rotation when an AlertView is presented.
Do you know what's going on?
Hi,
First of all, I'm not 100% sure this is a bug in DLAlertView. Since I'm using it with JASidePanels library, it may be incompatibility between JASidePanels and DLAlertView.
My app shows white (aKa light content) status bar. But when alert is shown, status bar switches to black text (default). It looks like DLAVAlertViewController doesn't return preferredStatusBarStyle at all. I solved this issue in my app by adding a category onto DLAVAlertViewController:
@implementation DLAVAlertViewController (AlertStatusBar)
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
@end
I wonder if it would make sense to make this themable via DLAVAlertViewTheme.
Layout is broken in case if there are no title specified. Try to init the alert with message filled, while there are no title.
Hi there,
Thanks a lot for opensourcing DLAlertview. I made a podspec file for it that I would like to share, the only problem is that it's recommended to use version tags in the spec file. Could you please tag the current version?
Thanks!
Would it be possible to expose the UITextFields so that we can respond to the UITextFieldDelegate methods? I notice that internally you are responding to those calls, so I'm not sure if this would be possible.
What I'm trying to do is limit/manipulate the text that is being inputted in the text fields.
Thanks.
Hello guys, I've been using your alert, and it's really great!! It allowed me to match my app style in all the UI, so thanks for that.
Regarding this issue, I'm opening it because I'm experiencing a pretty weird situation in which an instance of MFMailComposeViewController can be presented but it's view is never visible, because the presenting UIViewController _viewDidLoad_ method is called twice.
To clarify it a bit, here is a summary of the situation:
@property (nonatomic, strong) DLAVAlertView *compressionAlertView;
[self.compressionAlertView showWithCompletion:^(DLAVAlertView *alertView, NSInteger buttonIndex){
switch (buttonIndex) {
case 0:
[self sharePhoto:photo withCompressionRate:1];
break;
case 1:
[self sharePhoto:photo withCompressionRate:0.5];
break;
case 2:
[self sharePhoto:photo withCompressionRate:0.25];
break;
default:
break;
}}];
- (void)sharePhoto:(WMMPhoto *)photo withCompressionRate:(CGFloat)compression
{
if ([MFMailComposeViewController canSendMail]) {
// some code to set up email fields ...
[self presentViewController:mailComposer animated:YES completion:nil];
}
}
The thing is that the first time I want to share a photo my UIViewController viewDidLoad method is called after DLAVAlertViewController executes the following code. At the time that the MFMailComposer if presented and that's how I ended up in a situation in which my mailComposer is presented, but its not visible in my view hierarchy.
- (void)removeAlertView:(DLAVAlertView *)alertView {
[alertView removeFromSuperview];
[self.alertViews removeObject:alertView];
DLAVAlertView *previousAlertView = [self.alertViews lastObject];
if (previousAlertView) {
[self.view addSubview:previousAlertView];
[previousAlertView unhideWithCompletion:nil];
self.currentAlertView = previousAlertView;
}
if (!self.alertViews.count) {
[self hideBackgroundViewWithCompletion:^(BOOL finished) {
self.alertWindow.hidden = YES;
[self.mainWindow makeKeyAndVisible];
}];
}
}
If I remove * [self.mainWindow makeKeyAndVisible];* and that's fixed the problem, I can present MFMailComposeViewController without any problem.
But I would like to fully understand why closing the alertView and trying to present a mailComposer could be causing this problem.
If you 'd be able to explain my behaviour a bit further, or the way in which your alert view manage the UIWindow and why it'd be causing the viewDidLoad method to be called twice I'd really appreciate it.
At the moment I needed to remove [self.mainWindow makeKeyAndVisible]; to fix the bug, but I'd like to be sure what are the consequences of doing this.
Hi,
I'm having issues using your lib on old iOS versions, especially since the last bugfix:
DLAVAlertViewController
line 218:
[super viewWillTransitionToSize: size withTransitionCoordinator: coordinator];
This method doesn't exist before iOS8 and compiling with it is an issue. Could you add a respondsToSelect:
test?
Thank you !
It seems like I had to modify the class to accomplish it.
If otherwise, can you provide some sample code?
I did profile with iOS9, and it shows that everytime when i dismiss the alertview, it shows up a memory leak in the method. However I cannot find the problem.
Per your instructions, I copied all the files in the Classes folder into my project. However, when attempting to build I receive a myriad of errors (about 48) without even having used the files yet. Any ideas?
There is not the alertViewCancel
, the alertView:clickedButtonAtIndex:
will be called in the dismissWithBackdropTap
at first. Then the second called in the - (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated
.
Please add ability display content in the top. Now it's always in the bottom. I think problem is here:
// Layout title:
if (self.title) {
[self layoutTitleLabelWithTheme:theme inAlertWithSize:alertSize atVerticalOffset:&offset];
}
// Layout message:
if (self.message) {
[self layoutMessageLabelWithTheme:theme inAlertWithSize:alertSize atVerticalOffset:&offset];
}
self.messageLabel.hidden = self.message == nil;
// Layout content view:
if (self.contentView) {
I know, this one is kinda old, but I found this alert-view replacement being by far the most accomplished and it's amazing to see that by changing only a couple of lines you can make it work perfectly on iOS5 (tested on 3GS 5.1.1).
The method body affected is +optimalSizeForLabel:inMaxSize:
where the if condition should be using the macro #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
( or 61000
) instead of a test on the Foundation version. This prevents the use of NSFontAttributeName
that iOS5 doesn't know and will crash trying to load it.
I don't think that's too much of an issue to modify this, and would be very pleased to see it in future commits !
Have a great day
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.