-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathURBAlertView.h
More file actions
97 lines (76 loc) · 3.94 KB
/
URBAlertView.h
File metadata and controls
97 lines (76 loc) · 3.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//
// URBAlertView.h
// URBFlipModalViewControllerDemo
//
// Created by Nicholas Shipes on 12/21/12.
// Copyright (c) 2012 Urban10 Interactive. All rights reserved.
//
#import <UIKit/UIKit.h>
enum {
URBAlertAnimationDefault = 0,
URBAlertAnimationFade,
URBAlertAnimationFlipHorizontal,
URBAlertAnimationFlipVertical,
URBAlertAnimationTumble,
URBAlertAnimationSlideLeft,
URBAlertAnimationSlideRight
};
typedef NSInteger URBAlertAnimation;
@interface URBAlertView : UIView <UITextFieldDelegate>
typedef void (^URBAlertViewBlock)(NSInteger buttonIndex, URBAlertView *alertView);
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *message;
@property (nonatomic, strong) UIView *contentView;
///-----------------
/// @name Appearance
///-----------------
@property (nonatomic, strong) UIColor *backgroundColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) CGFloat backgroundGradation UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *strokeColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) CGFloat strokeWidth UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) CGFloat cornerRadius UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIFont *titleFont UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *titleColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *titleShadowColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) CGSize titleShadowOffset UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIFont *messageFont UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *messageColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *messageShadowColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) CGSize messageShadowOffset UI_APPEARANCE_SELECTOR;
//------------------------
// @name Button Appearance
//------------------------
@property (nonatomic, strong) UIColor *buttonBackgroundColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *buttonStrokeColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) CGFloat buttonStrokeWidth UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *cancelButtonBackgroundColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIFont *textFieldFont UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) BOOL darkenBackground;
@property (nonatomic, assign) BOOL blurBackground;
+ (URBAlertView *)dialogWithTitle:(NSString *)title message:(NSString *)message;
- (id)initWithTitle:(NSString *)title message:(NSString *)message;
- (id)initWithTitle:(NSString *)title
message:(NSString *)message
cancelButtonTitle:(NSString *)cancelButtonTitle
otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION;
- (NSInteger)addButtonWithTitle:(NSString *)title;
- (void)addTextFieldWithPlaceholder:(NSString *)placeholder secure:(BOOL)secure;
- (NSString *)textForTextFieldAtIndex:(NSUInteger)index;
- (void)setTitleTextAttributes:(NSDictionary *)textAttributes UI_APPEARANCE_SELECTOR;
- (void)setMessageTextAttributes:(NSDictionary *)textAttributes UI_APPEARANCE_SELECTOR;
- (void)setButtonTextAttributes:(NSDictionary *)textAttributes forState:(UIControlState)state UI_APPEARANCE_SELECTOR;
- (void)setCancelButtonTextAttributes:(NSDictionary *)textAttributes forState:(UIControlState)state UI_APPEARANCE_SELECTOR;
- (void)setTextFieldTextAttributes:(NSDictionary *)textAttributes;
- (void)setHandlerBlock:(URBAlertViewBlock)block;
///--------------------------------
/// @name Presenting and Dismissing
///--------------------------------
- (void)show;
- (void)showWithCompletionBlock:(void(^)())completion;
- (void)showWithAnimation:(URBAlertAnimation)animation;
- (void)showWithAnimation:(URBAlertAnimation)animation completionBlock:(void(^)())completion;
- (void)hide;
- (void)hideWithCompletionBlock:(void(^)())completion;
- (void)hideWithAnimation:(URBAlertAnimation)animation;
- (void)hideWithAnimation:(URBAlertAnimation)animation completionBlock:(void(^)())completion;
@end