forked from kgn/KGModal
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathKGModal.h
65 lines (48 loc) · 2.09 KB
/
KGModal.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
58
59
60
61
62
63
64
65
//
// KGModal.h
// KGModal
//
// Created by David Keegan on 10/5/12.
// Copyright (c) 2012 David Keegan. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ENUM(NSUInteger, KGModalBackgroundDisplayStyle){
KGModalBackgroundDisplayStyleGradient,
KGModalBackgroundDisplayStyleSolid
};
@interface KGModal : NSObject
// Determines if the modal should dismiss if the user taps outside of the modal view
// Defaults to YES
@property (nonatomic) BOOL tapOutsideToDismiss;
// Determins if the close button or tapping outside the modal should animate the dismissal
// Defaults to YES
@property (nonatomic) BOOL animateWhenDismissed;
// Determins if the close button is shown
// Defaults to YES
@property (nonatomic) BOOL showCloseButton;
// The background color of the modal window
// Defaults black with 0.5 opacity
@property (strong, nonatomic) UIColor *modalBackgroundColor;
// The background display style, can be a transparent radial gradient or a transparent black
// Defaults to gradient, this looks better but takes a bit more time to display on the retina iPad
@property (nonatomic) enum KGModalBackgroundDisplayStyle backgroundDisplayStyle;
// Determins if the modal should rotate when the device rotates
// Defaults to YES, only applies to iOS5
@property (nonatomic) BOOL shouldRotate;
// The shared instance of the modal
+ (id)sharedInstance;
// Set the content view to display in the modal and display with animations
- (void)showWithContentView:(UIView *)contentView;
// Set the content view to display in the modal and whether the modal should animate in
- (void)showWithContentView:(UIView *)contentView andAnimated:(BOOL)animated;
// Hide the modal with animations
- (void)hide;
// Hide the modal with animations,
// run the completion after the modal is hidden
- (void)hideWithCompletionBlock:(void(^)())completion;
// Hide the modal and whether the modal should animate away
- (void)hideAnimated:(BOOL)animated;
// Hide the modal and whether the modal should animate away,
// run the completion after the modal is hidden
- (void)hideAnimated:(BOOL)animated withCompletionBlock:(void(^)())completion;
@end