-
Notifications
You must be signed in to change notification settings - Fork 10
/
KGDiscreetAlertView.h
53 lines (39 loc) · 2.24 KB
/
KGDiscreetAlertView.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
//
// KGDiscreetAlertView.h
// KGDiscreetAlertView
//
// Created by David Keegan on 9/11/12.
// Copyright (c) 2012 David Keegan. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface KGDiscreetAlertView : UIView
@property (nonatomic) BOOL tapToHide;
#pragma mark - Convenience Class Methods
// Show a discreet alert with the given text in a view,
// the alert will be automatically dismissed after 3 seconds.
+ (instancetype)showDiscreetAlertWithText:(NSString *)text inView:(UIView *)view;
// Show a discreet alert with the given text in a view,
// the alert will be automatically dismissed after the specified delay.
// If the delay is 0 the alert will be 'sticky' and will not be dismissed until `hide` is called.
+ (instancetype)showDiscreetAlertWithText:(NSString *)text inView:(UIView *)view delay:(NSTimeInterval)delay;
// Show a discreet alert with the given text in a view, and a max width for the alert.
// The alert will be automaticly dismissed after the specified delay,
// if the delay is 0 the alert will be 'sticky' and will not be dismissed until `hide` is called.
+ (instancetype)showDiscreetAlertWithText:(NSString *)text inView:(UIView *)view maxWidth:(CGFloat)maxWidth delay:(NSTimeInterval)delay;
// Hide all of the discreet alerts in a given view.
+ (void)hideAllDiscreetAlertsInView:(UIView *)view;
#pragma mark - Instance Methods
// Show a discreet alert with the given text in a view,
// the alert will be automatically dismissed after 3 seconds.
- (void)showWithText:(NSString *)text inView:(UIView *)view;
// Show a discreet alert with the given text in a view,
// the alert will be automatically dismissed after the specified delay.
// If the delay is 0 the alert will be 'sticky' and will not be dismissed until `hide` is called.
- (void)showWithText:(NSString *)text inView:(UIView *)view delay:(NSTimeInterval)delay;
// Show a discreet alert with the given text in a view, and a max width for the alert.
// The alert will be automatically dismissed after the specified delay,
// if the delay is 0 the alert will be 'sticky' and will not be dismissed until `hide` is called.
- (void)showWithText:(NSString *)text inView:(UIView *)view maxWidth:(CGFloat)maxWidth delay:(NSTimeInterval)delay;
// Dismiss the discreet alert.
- (void)hide;
@end