forked from steipete/PSPushPopPressView
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PSPushPopPressView.h
executable file
·82 lines (59 loc) · 2.94 KB
/
PSPushPopPressView.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
//
// PSPushPopPressView.h
// PSPushPopPressView
//
// Based on BSSPushPopPressView by Blacksmith Software.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
@class PSPushPopPressView;
@protocol PSPushPopPressViewDelegate <NSObject>
@optional
/// manipulation starts, user has >= 2 fingers on the view
- (void)pushPopPressViewDidStartManipulation:(PSPushPopPressView *)pushPopPressView;
/// manipulation stopps, user has < 2 fingers on the view
- (void)pushPopPressViewDidFinishManipulation:(PSPushPopPressView *)pushPopPressView;
/// view will animate back to original frame
- (void)pushPopPressViewWillAnimateToOriginalFrame:(PSPushPopPressView *)pushPopPressView duration: (NSTimeInterval)duration;
/// animation to original frame is finished
- (void)pushPopPressViewDidAnimateToOriginalFrame:(PSPushPopPressView *)pushPopPressView;
- (void)pushPopPressViewWillAnimateToFullscreenWindowFrame:(PSPushPopPressView *)pushPopPressView duration: (NSTimeInterval)duration;
- (void)pushPopPressViewDidAnimateToFullscreenWindowFrame:(PSPushPopPressView *)pushPopPressView;
- (BOOL)pushPopPressViewShouldAllowTapToAnimateToOriginalFrame:(PSPushPopPressView *)pushPopPressView;
- (BOOL)pushPopPressViewShouldAllowTapToAnimateToFullscreenWindowFrame:(PSPushPopPressView *)pushPopPressView;
/// only active if allowSingleTapSwitch is enabled (default)
- (void)pushPopPressViewDidReceiveTap:(PSPushPopPressView *)pushPopPressView;
@end
@interface PSPushPopPressView : UIView <UIGestureRecognizerDelegate> {
UITapGestureRecognizer* tapRecognizer_;
UILongPressGestureRecognizer* doubleTouchRecognizer;
UIPanGestureRecognizer* panRecognizer_;
CGAffineTransform scaleTransform_;
CGAffineTransform rotateTransform_;
CGAffineTransform panTransform_;
CGRect initialFrame_;
BOOL allowSingleTapSwitch_;
BOOL fullscreen_;
BOOL ignoreStatusBar_;
BOOL anchorPointUpdated;
}
/// the delegate for the PushPopPressView
@property (nonatomic, unsafe_unretained) id<PSPushPopPressViewDelegate> pushPopPressViewDelegate;
/// returns true if fullscreen is enabled
@property (nonatomic, readonly, getter=isFullscreen) BOOL fullscreen;
/// true if one or more fingers are on the view
@property (nonatomic, readonly, getter=isBeingDragged) BOOL beingDragged;
/// set initialFrame if you change frame after initWithFrame
@property (nonatomic, assign) CGRect initialFrame;
/// allow mode switching via single tap. Defaults to YES.
@property (nonatomic, assign) BOOL allowSingleTapSwitch;
/// if true, [UIScreen mainScreen] is used for coordinates (vs rootView)
@property (nonatomic, assign) BOOL ignoreStatusBar;
/// animate/move to fullscreen
- (void)moveToFullscreenWindowAnimated:(BOOL)animated;
/// animate/moves to initialFrame size
- (void)moveToOriginalFrameAnimated:(BOOL)animated;
/// align view based on current size (either initialPosition or fullscreen)
- (void)alignViewAnimated:(BOOL)animated bounces:(BOOL)bounces;
@end