Yini  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
ZUUIRevealController.h
Go to the documentation of this file.
1 /*
2 
3  Copyright (c) 2011, Philip Kluz (Philip.Kluz@zuui.org)
4  All rights reserved.
5 
6  Redistribution and use in source and binary forms, with or without
7  modification, are permitted provided that the following conditions are met:
8 
9  * Redistributions of source code must retain the above copyright
10  notice, this list of conditions and the following disclaimer.
11 
12  * Redistributions in binary form must reproduce the above copyright
13  notice, this list of conditions and the following disclaimer in the
14  documentation and/or other materials provided with the distribution.
15 
16  * Neither the name of Philip Kluz, 'zuui.org' nor the names of its contributors may
17  be used to endorse or promote products derived from this software
18  without specific prior written permission.
19 
20  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23  DISCLAIMED. IN NO EVENT SHALL PHILIP KLUZ BE LIABLE FOR ANY DIRECT,
24  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31  */
32 
33 #import <UIKit/UIKit.h>
34 
35 typedef enum
36 {
40 
42 
43 @interface ZUUIRevealController : UIViewController <UITableViewDelegate>
44 
45 // Public Properties:
46 @property (retain, nonatomic) IBOutlet UIViewController *frontViewController;
47 @property (retain, nonatomic) IBOutlet UIViewController *rearViewController;
48 @property (assign, nonatomic) FrontViewPosition currentFrontViewPosition;
49 @property (assign, nonatomic) id<ZUUIRevealControllerDelegate> delegate;
50 
51 // Public Methods:
52 - (id)initWithFrontViewController:(UIViewController *)aFrontViewController rearViewController:(UIViewController *)aBackViewController;
53 - (void)revealGesture:(UIPanGestureRecognizer *)recognizer;
54 - (void)revealToggle:(id)sender;
55 
56 - (void)setFrontViewController:(UIViewController *)frontViewController;
57 - (void)setFrontViewController:(UIViewController *)frontViewController animated:(BOOL)animated;
58 
59 @end
60 
61 // ZUUIRevealControllerDelegate Protocol.
62 @protocol ZUUIRevealControllerDelegate<NSObject>
63 
64 @optional
65 
66 - (BOOL)revealController:(ZUUIRevealController *)revealController shouldRevealRearViewController:(UIViewController *)rearViewController;
67 - (BOOL)revealController:(ZUUIRevealController *)revealController shouldHideRearViewController:(UIViewController *)rearViewController;
68 
69 /*
70  * IMPORTANT: It is not guaranteed that 'didReveal...' will be called after 'willReveal...'. The user
71  * might not have panned far enough for a reveal to be triggered! Thus 'didHide...' will be called!
72  */
73 - (void)revealController:(ZUUIRevealController *)revealController willRevealRearViewController:(UIViewController *)rearViewController;
74 - (void)revealController:(ZUUIRevealController *)revealController didRevealRearViewController:(UIViewController *)rearViewController;
75 
76 - (void)revealController:(ZUUIRevealController *)revealController willHideRearViewController:(UIViewController *)rearViewController;
77 - (void)revealController:(ZUUIRevealController *)revealController didHideRearViewController:(UIViewController *)rearViewController;
78 
79 #pragma mark - New in 0.9.5
80 
81 - (void)revealController:(ZUUIRevealController *)revealController willSwapToFrontViewController:(UIViewController *)frontViewController;
82 - (void)revealController:(ZUUIRevealController *)revealController didSwapToFrontViewController:(UIViewController *)frontViewController;
83 
84 @end