TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | Apache 2 |
ReleasedLast Release | Mar 2015 |
Maintained by Darktt.
IMPORTANT: UIWindow appearance changed on iOS 8, I cant not fix it on landscape view.
So I will create a new one for iOS8.
Custom alert view to solved the UIAlertView can't addSubview problem on iOS7.
NEW Feature:
New effect for show and dismiss animations.
And also can use different dismiss animation at click different button.
New method -showForPasswordInputWithAnimation: for input password scenario, and animation -shakeAlertView for password error scenario.
Q: How to hidden status bar when alert presented on iOS 7?
A: Set UIViewControllerBasedStatusBarAppearance to NO in your info.plist, the status bar won't appear again.
QuartzCore
framework.DTAlertView
folder into your project.Import the header file and declare in want to used class.
#import "DTAlertView.h"
// initial for class method
DTAlertView *alertView = [DTAlertView alertViewWithTitle:@"Demo" message:@"This is normal alert view." delegate:nil cancelButtonTitle:@"Cancel" positiveButtonTitle:@"OK"];
// inital for instance method
DTAlertView *alertView = [[DTAlertView alloc] initWithTitle:@"Demo" message:@"This is normal alert view." delegate:nil cancelButtonTitle:@"Cancel" positiveButtonTitle:@"OK"];
and you can use Block with alert view:
DTAlertViewButtonClickedBlock block = ^(DTAlertView *_alertView, NSUInteger buttonIndex, NSUInteger cancelButtonIndex){
// You can get button title of clicked button.
NSLog(@"%@", _alertView.clickedButtonTitle);
};
DTAlertView *alertView = [DTAlertView alertViewUseBlock:block title:@"Demo" message:@"This is normal alert view with block." cancelButtonTitle:@"Cancel" positiveButtonTitle:nil];
Show alert view:
[alertView show];
Dismiss alert view:
[alertView dismiss];
Copy codesnippet files under Code Snippet
folder to ~/Library/Developer/Xcode/UserData/CodeSnippets/
.
You can find code snippet at there.
Or use key word DTAlertViewButtonClickedBlock
or DTAlertViewTextDidChangeBlock
.
Copy com.darktt.DTAlertView.docset
file under Docset
folder to ~/Library/Developer/Shared/Documentation/DocSets/
.
You can find it in Documentation Viewer.
Add com.darktt.DTAlertView.docset
file under Docset
folder on Dash preferences.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied.
See the License for the specific language governing permissions
and limitations under the License.