mysterioustrousers / mtblockalertview Goto Github PK
View Code? Open in Web Editor NEWAn iOS Alert View that uses block-based delegation instead of protocols.
License: BSD 2-Clause "Simplified" License
An iOS Alert View that uses block-based delegation instead of protocols.
License: BSD 2-Clause "Simplified" License
Is there a reason the podspec specifies a minimum iOS version of 5.1? Glancing at the code, I don't see anything that wouldn't be supported by iOS 5.0.
Temporary solved by calling MTBlockAlertView in async way:
+ (void) showWithTitle:(NSString *)title
message:(NSString *)message
cancelButtonTitle:(NSString *)cancelButtonTitle
otherButtonTitle:(NSString *)otherButtonTitle
alertViewStyle:(UIAlertViewStyle)alertViewStyle
completionBlock:(void (^)(UIAlertView *alertView, NSInteger buttonIndex))completionBlock {
dispatch_async(dispatch_get_main_queue(), ^{
MTBlockAlertView *alertView = [[MTBlockAlertView alloc] initWithTitle:title
message:message
completionHanlder:completionBlock
cancelButtonTitle:cancelButtonTitle
otherButtonTitles:otherButtonTitle, nil];
alertView.alertViewStyle = alertViewStyle;
[alertView show];
});
}
I don't know if it is a good way to solve it, but at least it works.
Environment:
iOS6 on iphone 4
Hi, this is great library, all of my projects are using this alert view!
Can we have return instance so that we can set the alert's property ?
MTBlockAlertView* alertView = [MTBlockAlertView showWithTitle ... ];
UITextField *username = [alertView textFieldAtIndex:0];
username.placeholder = @"Enter user name";
...
Many thanks!
In the README, the section called "A little more control" shows a code sample. In the sample, the completion block should only have one parameter, not two.
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.