-
Notifications
You must be signed in to change notification settings - Fork 12
/
DPToastView.h
57 lines (46 loc) · 2.07 KB
/
DPToastView.h
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
//
// DPToastView.h
// DPToastViewDemo
//
// Created by Baker, Eric on 2/15/13.
// Copyright (c) 2013 DuneParkSoftware, LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef enum {
DPToastGravityTop = 0,
DPToastGravityCenter,
DPToastGravityBottom
} DPToastGravity;
typedef enum {
DPToastDurationShort = 2,
DPToastDurationNormal = 4,
DPToastDurationLong = 10,
DPToastDurationInfinite = NSIntegerMax
} DPToastDuration;
#define DPToastViewWillAppearNotification @"DPToastViewWillAppearNotificatio"
#define DPToastViewDidAppearNotification @"DPToastViewDidAppearNotification"
#define DPToastViewWillDisappearNotification @"DPToastViewWillDisappearNotification"
#define DPToastViewDidDisappearNotification @"DPToastViewDidDisappearNotification"
#define DPToastViewDidDismissNotification @"DPToastViewDidDismissNotification"
#define DPToastViewUserInfoKey @"DPToastViewUserInfoKey"
#define DPToastViewStringUserInfoKey @"DPToastViewStringUserInfoKey"
@interface DPToastView : NSObject
@property (strong, nonatomic) id message;
@property (assign, nonatomic) NSTextAlignment textAlignment;
@property (assign, nonatomic) NSLineBreakMode lineBreakMode;
@property (assign, nonatomic) DPToastGravity gravity;
@property (assign, nonatomic) NSTimeInterval duration;
@property (strong, nonatomic) UIColor *textColor, *backgroundColor, *borderColor, *shadowColor;
@property (strong, nonatomic) UIFont *font;
@property (assign, nonatomic) CGFloat borderWidth, cornerRadius, shadowOpacity, shadowRadius, fadeInDuration, fadeOutDuration;
@property (assign, nonatomic) CGSize shadowOffset;
@property (assign, nonatomic) UIEdgeInsets innerEdgeInsets;
@property (assign, nonatomic) NSInteger yOffset;
+ (id)makeToast:(id)message;
+ (id)makeToast:(id)message gravity:(DPToastGravity)gravity;
+ (id)makeToast:(id)message duration:(NSTimeInterval)duration;
+ (id)makeToast:(id)message gravity:(DPToastGravity)gravity duration:(NSTimeInterval)duration;
+ (void)dismissToast;
- (void)show;
- (void)showInView:(UIView *)view;
@end