-
Notifications
You must be signed in to change notification settings - Fork 250
/
FPPopoverController.h
84 lines (61 loc) · 2.55 KB
/
FPPopoverController.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//
// FPPopoverController.h
//
// Created by Alvise Susmel on 1/5/12.
// Copyright (c) 2012 Fifty Pixels Ltd. All rights reserved.
//
// https://github.com/50pixels/FPPopover
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import "ARCMacros.h"
#import "FPPopoverView.h"
#import "FPTouchView.h"
@class FPPopoverController;
@protocol FPPopoverControllerDelegate <NSObject>
@optional
- (void)popoverControllerDidDismissPopover:(FPPopoverController *)popoverController;
- (void)presentedNewPopoverController:(FPPopoverController *)newPopoverController
shouldDismissVisiblePopover:(FPPopoverController*)visiblePopoverController;
@end
@interface FPPopoverController : UIViewController
{
UIView *_parentView;
}
//ARC-enable and disable support
#if __has_feature(objc_arc)
@property(nonatomic,weak) id<FPPopoverControllerDelegate> delegate;
#else
@property(nonatomic,assign) id<FPPopoverControllerDelegate> delegate;
#endif
/** @brief FPPopoverArrowDirectionAny, FPPopoverArrowDirectionVertical or FPPopoverArrowDirectionHorizontal for automatic arrow direction.
**/
/** @brief allow reading in order to integrate other open-source **/
@property(nonatomic,readonly) FPTouchView* touchView;
@property(nonatomic,readonly) FPPopoverView* contentView;
@property(nonatomic,assign) FPPopoverArrowDirection arrowDirection;
@property(nonatomic,assign) CGSize contentSize;
@property(nonatomic,assign) CGPoint origin;
@property(nonatomic,assign) CGFloat alpha;
/** @brief The tint of the popover. **/
@property(nonatomic,assign) FPPopoverTint tint;
/** @brief Popover border, default is YES **/
@property(nonatomic, assign) BOOL border;
/** @brief Initialize the popover with the content view controller
**/
-(id)initWithViewController:(UIViewController*)viewController;
-(id)initWithViewController:(UIViewController*)viewController
delegate:(id<FPPopoverControllerDelegate>)delegate;
/** @brief Presenting the popover from a specified view **/
-(void)presentPopoverFromView:(UIView*)fromView;
/** @brief Presenting the popover from a specified point **/
-(void)presentPopoverFromPoint:(CGPoint)fromPoint;
/** @brief Dismiss the popover **/
-(void)dismissPopoverAnimated:(BOOL)animated;
/** @brief Dismiss the popover with completion block for post-animation cleanup **/
typedef void (^FPPopoverCompletion)();
-(void)dismissPopoverAnimated:(BOOL)animated completion:(FPPopoverCompletion)completionBlock;
/** @brief Hide the shadows to get better performances **/
-(void)setShadowsHidden:(BOOL)hidden;
/** @brief Refresh popover **/
-(void)setupView;
@end