UIAlertView(ETFramework) Category Reference
| Declared in | ETAlert.h |
Overview
UIAlertView (ETFramework) is a helper category that adds some better handling functionality to UIAlertView objects.
Tasks
Show UIAlertView objects
Show UIAlertView objects with predefined title (AppName)
Show NSError as UIAlertView with predefined title (AppName)
Initialization methods.
Class Methods
showAlertWithAppTitleAndError:
Shows a UIAlertView with the AppName as the title and the localizedDescription property of the provided NSError as the body.
+ (void)showAlertWithAppTitleAndError:(NSError *)errorParameters
- error
The
NSErrorthat will be displayed in theUIAlertView.
Declared In
ETAlert.hshowAlertWithAppTitleAndError:completionHandler:
Shows a UIAlertView with the AppName as the title and the localizedDescription property of the provided NSError as the body.
+ (void)showAlertWithAppTitleAndError:(NSError *)error completionHandler:(void ( ^ ) ( NSInteger buttonIndex ))completionHandlerParameters
- error
The
NSErrorthat will be displayed in theUIAlertView.
- completionHandler
The code
blockthat will be executed when any button is tapped on the shownUIAlertView.
Declared In
ETAlert.hshowAlertWithAppTitleAndMessage:completionHandler:
Shows a UIAlertView object with the AppName as the UIAlertView title and the provided message and executes the provided code block whenever a button on the shown UIAlertView is tapped.
+ (void)showAlertWithAppTitleAndMessage:(NSString *)alertMessage completionHandler:(void ( ^ ) ( NSInteger buttonIndex ))completionHandlerParameters
- alertMessage
The
NSStringobject that will be displayed as theUIAlertViewbody message.
- completionHandler
The code
blockthat will be executed when any button is tapped on the shownUIAlertView.
Declared In
ETAlert.hshowAlertWithAppTitleAndMessage:delegate:
Shows a UIAlertView object with the AppName as the UIAlertView title and the provided message and delegate.
+ (void)showAlertWithAppTitleAndMessage:(NSString *)alertMessage delegate:(id<UIAlertViewDelegate>)delegateParameters
- alertMessage
The
NSStringobject that will be displayed as theUIAlertViewbody message.
- delegate
The
id<UIAlertViewDelegate>object that will be set as the delegate of the shownUIAlertView.
Declared In
ETAlert.hshowAlertWithTitle:message:completionHandler:
Shows a UIAlertView object with the provided title, message and completion block.
+ (void)showAlertWithTitle:(NSString *)alertTitle message:(NSString *)alertMessage completionHandler:(void ( ^ ) ( NSInteger buttonIndex ))completionHandlerParameters
- alertTitle
The
NSStringobject that will be used as theUIAlertViewtitle.
- alertMessage
The
NSStringobject that will be displayed as theUIAlertViewbody message.
- completionHandler
The code
blockthat will be executed when any button is tapped on the shownUIAlertView.
Declared In
ETAlert.hshowAlertWithTitle:message:delegate:
Shows a UIAlertView object with the provided title, message and delegate.
+ (void)showAlertWithTitle:(NSString *)alertTitle message:(NSString *)alertMessage delegate:(id<UIAlertViewDelegate>)delegateParameters
- alertTitle
The
NSStringobject that will be used as theUIAlertViewtitle.
- alertMessage
The
NSStringobject that will be displayed as theUIAlertViewbody message.
- delegate
The
id<UIAlertViewDelegate>object that will be set as the delegate of the shownUIAlertView.
Declared In
ETAlert.hInstance Methods
initWithTitle:message:completionHandler:buttonTitles:
Creates a UIAlertView object with the provided details.
- (id)initWithTitle:(NSString *)title message:(NSString *)message completionHandler:(void ( ^ ) ( NSInteger buttonIndex ))completionHandler buttonTitles:(NSString *)defaultButtonTitle, ...Parameters
- title
The
NSStringobject that will be used as theUIAlertViewtitle.
- message
The
NSStringobject that will be used as theUIAlertViewmessage body.
- completionHandler
The code
blockthat will be executed when any button is tapped on the shownUIAlertView.
- defaultButtonTitle
The
NSStringthat will be used as the default button title.
- ...
More
NSStringobjects (separated by,) that can be used as additional buttons on theUIAlertView(Up to 16 objects/buttons).
Return Value
A UIAlertView initialized with the provided parameterds. The UIAlertView is just initialized but not shown.
Declared In
ETAlert.h