forked from weiran/Hackers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added side slide view controller with JSSlidingViewController.
- Loading branch information
Showing
4 changed files
with
828 additions
and
0 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
Libraries/JSSlidingViewController/JSSlidingViewController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// | ||
// JSSlidingViewController.h | ||
// JSSlidingViewControllerSample | ||
// | ||
// Created by Jared Sinclair on 6/19/12. | ||
// Copyright (c) 2012 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@protocol JSSlidingViewControllerDelegate; | ||
|
||
extern NSString * const JSSlidingViewControllerWillOpenNotification; | ||
extern NSString * const JSSlidingViewControllerWillCloseNotification; | ||
extern NSString * const JSSlidingViewControllerDidOpenNotification; | ||
extern NSString * const JSSlidingViewControllerDidCloseNotification; | ||
extern NSString * const JSSlidingViewControllerWillBeginDraggingNotification; | ||
|
||
@interface JSSlidingViewController : UIViewController | ||
|
||
@property (nonatomic, readonly) BOOL animating; | ||
@property (nonatomic, readonly) BOOL isOpen; | ||
@property (nonatomic, assign) BOOL locked; | ||
@property (nonatomic, assign) BOOL frontViewControllerHasOpenCloseNavigationBarButton; // Defaults to YES. | ||
@property (nonatomic, readonly) UIViewController *frontViewController; | ||
@property (nonatomic, readonly) UIViewController *backViewController; | ||
@property (nonatomic, weak) id <JSSlidingViewControllerDelegate> delegate; | ||
@property (nonatomic, assign) BOOL allowManualSliding; | ||
@property (assign, nonatomic) BOOL useBouncyAnimations; | ||
@property (assign, nonatomic) BOOL shouldTemporarilyRemoveBackViewControllerWhenClosed; | ||
|
||
- (id)initWithFrontViewController:(UIViewController *)frontVC backViewController:(UIViewController *)backVC; | ||
- (void)closeSlider:(BOOL)animated completion:(void (^)(void))completion; | ||
- (void)openSlider:(BOOL)animated completion:(void (^)(void))completion; | ||
- (void)setFrontViewController:(UIViewController *)viewController animated:(BOOL)animated completion:(void (^)(void))completion; | ||
- (void)setBackViewController:(UIViewController *)viewController animated:(BOOL)animated completion:(void (^)(void))completion; | ||
- (void)setWidthOfVisiblePortionOfFrontViewControllerWhenSliderIsOpen:(CGFloat)width; | ||
|
||
@end | ||
|
||
// Note: These delegate methods are called *after* any completion blocks have been performed. | ||
|
||
@protocol JSSlidingViewControllerDelegate <NSObject> | ||
|
||
@optional | ||
|
||
- (void)slidingViewControllerWillOpen:(JSSlidingViewController *)viewController; | ||
- (void)slidingViewControllerWillClose:(JSSlidingViewController *)viewController; | ||
- (void)slidingViewControllerDidOpen:(JSSlidingViewController *)viewController; | ||
- (void)slidingViewControllerDidClose:(JSSlidingViewController *)viewController; | ||
|
||
// If these are not implemented by the delegate, they return UIInterfaceOrientationPortrait for iPhone and all 4 orientations for iPad. | ||
- (NSUInteger)supportedInterfaceOrientationsForSlidingViewController:(JSSlidingViewController *)viewController; | ||
- (BOOL)slidingViewController:(JSSlidingViewController *)viewController shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation; | ||
|
||
@end |
Oops, something went wrong.