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 *)error
Parameters
- error
The
NSError
that will be displayed in theUIAlertView
.
Declared In
ETAlert.h
showAlertWithAppTitleAndError: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 ))completionHandler
Parameters
- error
The
NSError
that will be displayed in theUIAlertView
.
- completionHandler
The code
block
that will be executed when any button is tapped on the shownUIAlertView
.
Declared In
ETAlert.h
showAlertWithAppTitleAndMessage: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 ))completionHandler
Parameters
- alertMessage
The
NSString
object that will be displayed as theUIAlertView
body message.
- completionHandler
The code
block
that will be executed when any button is tapped on the shownUIAlertView
.
Declared In
ETAlert.h
showAlertWithAppTitleAndMessage: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>)delegate
Parameters
- alertMessage
The
NSString
object that will be displayed as theUIAlertView
body message.
- delegate
The
id<UIAlertViewDelegate>
object that will be set as the delegate of the shownUIAlertView
.
Declared In
ETAlert.h
showAlertWithTitle: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 ))completionHandler
Parameters
- alertTitle
The
NSString
object that will be used as theUIAlertView
title.
- alertMessage
The
NSString
object that will be displayed as theUIAlertView
body message.
- completionHandler
The code
block
that will be executed when any button is tapped on the shownUIAlertView
.
Declared In
ETAlert.h
showAlertWithTitle:message:delegate:
Shows a UIAlertView
object with the provided title, message and delegate.
+ (void)showAlertWithTitle:(NSString *)alertTitle message:(NSString *)alertMessage delegate:(id<UIAlertViewDelegate>)delegate
Parameters
- alertTitle
The
NSString
object that will be used as theUIAlertView
title.
- alertMessage
The
NSString
object that will be displayed as theUIAlertView
body message.
- delegate
The
id<UIAlertViewDelegate>
object that will be set as the delegate of the shownUIAlertView
.
Declared In
ETAlert.h
Instance 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
NSString
object that will be used as theUIAlertView
title.
- message
The
NSString
object that will be used as theUIAlertView
message body.
- completionHandler
The code
block
that will be executed when any button is tapped on the shownUIAlertView
.
- defaultButtonTitle
The
NSString
that will be used as the default button title.
- ...
More
NSString
objects (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