PPRevealSideViewController
==========================
This is a new controller container, showing views on the side like the Facebook or Path app. It is as easy to use as a navigation controller.
Sometimes, you need to push a new controller to show some options, but a small controller would be enough … PPRevealSideViewController is THE controller you need.
Pan and Tap gestures are also included !
[See a demo on Youtube!](http://www.youtube.com/watch?v=lsc7RQvyy20)
# Installation
The easiest way to install PPRevealSideViewController is via the [CocoaPods](http://cocoapods.org/) package manager, since it's really flexible and provides easy installation.
## Via CocoaPods
If you don't have cocoapods yet (shame on you), install it:
``` bash
$ [sudo] gem install cocoapods
$ pod setup
```
Go to the directory of your Xcode project, and Create and/or Edit your Podfile and add PPRevealSideViewController:
``` bash
$ cd /path/to/MyProject
$ touch Podfile
# Edit the podfile using your favorite editor
$ edit Podfile
platform :ios
pod 'PPRevealSideViewController', '~> 1.0.0'
```
Run the install:
``` bash
$ pod install
```
Finally, open your project in Xcode from the .xcworkspace file (not the usual project file! This is really important)
``` bash
$ open MyProject.xcworkspace
```
Import *PPRevealSideViewController.h* file to your PCH file or your AppDelegate file.
You are ready to go.
## Old fashionned way
1. Add PPRevealSideViewController as a submodule to your project
``` bash
$ cd /path/to/MyApplication
# If this is a new project, initialize git...
$ git init
$ git submodule add git://github.com/ipup/PPRevealSideViewController.git vendor/PPRevealSideViewController
$ git submodule update --init --recursive
```
2. In your XCode Project, take the *PPRevealSideViewController.h and .m* from PPRevealSideViewController folder and drag them into your project.
3. Import *PPRevealSideViewController.h* file to your PCH file or your AppDelegate file.
4. Add the QuartzCore Framework.
5. Start using this new controller!
# ARC Support
PPRevealSideViewController fully supports ARC *and* non-ARC modes out of the box, there is no configuration necessary. This is really convenient when you have older projects, or do no want to use ARC. ARC support has been tested with the Apple LLVM 3.0 compiler.
# Compatibility
The class if fully compatible from iOS 4 to iOS 7. Not tested yet on older versions like iOS 3, but there is no reasons it doesn't work.
Please note that this class use the new container methods of UIViewController since iOS 5. By using this class on iOS 4 for example, you need to be careful with rotation handling, and presentModalViewController stuff.
Some things you need to be aware on iOS 4 or older :
* the currentOrientation property is not passed to child controllers, so only the window rootViewController knows the currentOrientation. Always use the status bar orientation from UIApplication
* override willAnimateRotationToInterfaceOrientation method to relayout the subviews
* ALWAYS present modal view controller from reveal side view controller, not from the controller itself. Otherwise, you will see strange bug with memory warning and/or rotation (bad layout)
* There is no support on iOS 4 and older of hiding and showing status bar in the app. It's ok if the status bar is initially hidden or not
# Documentation
The class is documented. You can either browse into documentation/html folder and then open index.html (or found it online : http://ipup.github.com/PPRevealSideViewController or install the doc set into Xcode.
There are two sample codes :
* The first one is very simple, open it in EasySample
* The second one show all the configuration aspects : Open PPRevealSideViewController.xcodeproj
Two ways :
1. Go to Xcode, preferences, Downloads, + then enter the feed url http://ipup.github.com/PPRevealSideViewController/PPRevealSideViewController.atom
2.Follow these steps
* Quit Xcode
* Go to ~/Library/Developer/Shared/Documentation/DocSets and copy the Documentation/PPRevealSideViewController.docset file.
* Launch Xcode and Voilà !
## Use The BuildDocumentation Scheme
If you want to create the documentation, before running this target, you need to install AppleDoc :
https://github.com/tomaz/appledoc
# Usage
## Creating your controller
Somewhere, for example in your app delegate, alloc and init the controller :
_revealSideViewController = [[PPRevealSideViewController alloc] initWithRootViewController:rootController];
Then, add it to the window
self.window.rootViewController = _revealSideViewController;
or to a view
[self.view addSubview:_revealSideViewController.view];
You can add a navigation controller on top, for example :
MainViewController *main = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:main];
_revealSideViewController = [[PPRevealSideViewController alloc] initWithRootViewController:nav];
self.window.rootViewController = _revealSideViewController;
## Pushing a controller
You have several options to push a controller (see the documentation or the sample)
The easiest way is :
PopedViewController *c = [[PopedViewController alloc] initWithNibName:@"PopedViewController" bundle:nil ];
[self.revealSideViewController pushViewController:c onDirection:PPRevealSideDirectionBottom animated:YES];
This will push the controller on bottom, with a default offset.
You have four directions :
PPRevealSideDirectionBottom
PPRevealSideDirectionTop
PPRevealSideDirectionLeft
PPRevealSideDirectionRight
## Popping
To go back to your center controller from a side controller, you can pop :
[self.revealSideViewController popViewControllerAnimated:YES];
If you want to pop a new center controller, then do the following :
MainViewController *c = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil];
UINavigationController *n = [[UINavigationController alloc] initWithRootViewController:c];
[self.revealSideViewController popViewControllerWithNewCenterController:n animated:YES];
## Note if you don't have controllers for all the sides
If you want to present only a controller on the left and the right for example, you probably don't want the bouncing animation which shows that there is not yet a controller to present. This animation comes when you do a panning gesture with no preloaded controller, or no controller pushed yet on the triggered side.
In that case, do the following
[self.revealSideViewController setDirectionsToShowBounce:PPRevealSideDirectionLeft | PPRevealSideDirectionRight];
You could also don't want these animations at all. Disabled these like it
[self.revealSideViewController setDirectionsToShowBounce:PPRevealSideDirectionNone];
## Pushing from a side
If you are for example on the up side, and you want to push a controller on the left, you could call a method on your center controller asking him to display a left controller. But I thought it would be more convenient to provide a way to push an old controller directly. So, using the following will do the trick
[self.revealSideViewController pushOldViewControllerOnDirection:PPRevealSideDirectionLeft animated:YES];
If you are on top, and you want to push a new controller on top (why not), the default behavior of the controller would be to close the top side since it's open. But you can force it to pop push :
[self.revealSideViewController pushViewController:c onDirection:PPRevealSideDirectionTop animated:YES forceToPopPush:YES];
## Open Completely
You can open completely a side (take the example of Facebook app when you tap on search bar).
When you are on an opened side :
[self.revealSideViewController openCompletelyAnimated:YES];
Or when you want to open from the center controller (think to preload the controller)
没有合适的资源?快使用搜索试试~ 我知道了~
PPRevealSideViewController-master
共116个文件
m:17个
png:16个
h:15个
5星 · 超过95%的资源 需积分: 3 40 下载量 194 浏览量
2014-12-02
09:45:17
上传
评论
收藏 407KB ZIP 举报
温馨提示
最新的抽屉侧边栏效果,支持左右滑动和点击效果,最简洁和简明的类库,完全开源。
资源推荐
资源详情
资源评论
收起资源包目录
PPRevealSideViewController-master (116个子文件)
styles.css 9KB
styles.css 9KB
stylesPrint.css 304B
stylesPrint.css 304B
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
docSet.dsidx 268KB
.gitignore 21B
PPRevealSideViewController.h 30KB
AppDelegate.h 448B
AppDelegate.h 393B
ThirdViewController.h 393B
CustomCell.h 341B
WebViewController.h 329B
SecondViewController.h 319B
PopedViewController.h 307B
MainViewController.h 298B
TableViewController.h 278B
ModalViewController.h 274B
RootViewController.h 261B
LeftViewController.h 261B
LeftViewController.h 225B
SubViewController.h 180B
PPRevealSideViewController.html 98KB
PPRevealSideViewController.html 98KB
PPRevealSideViewControllerDelegate.html 28KB
PPRevealSideViewControllerDelegate.html 28KB
UIViewController+PPRevealSideViewController.html 8KB
UIViewController+PPRevealSideViewController.html 8KB
UIView+PPRevealSideViewController.html 8KB
UIView+PPRevealSideViewController.html 8KB
index.html 3KB
index.html 3KB
hierarchy.html 3KB
hierarchy.html 3KB
LICENSE 1KB
PPRevealSideViewController.m 78KB
TableViewController.m 9KB
AppDelegate.m 6KB
MainViewController.m 5KB
RootViewController.m 3KB
AppDelegate.m 3KB
LeftViewController.m 3KB
LeftViewController.m 3KB
WebViewController.m 2KB
ThirdViewController.m 2KB
CustomCell.m 2KB
ModalViewController.m 1KB
SecondViewController.m 1KB
PopedViewController.m 1KB
SubViewController.m 1KB
main.m 385B
main.m 369B
README.md 14KB
docSet.mom 14KB
project.pbxproj 29KB
project.pbxproj 13KB
PPRevealSideViewController-Prefix.pch 399B
EasySample-Prefix.pch 366B
PPRevealSideViewController-Info.plist 2KB
Info.plist 1KB
EasySample-Info.plist 1KB
xcschememanagement.plist 696B
xcschememanagement.plist 696B
xcschememanagement.plist 696B
xcschememanagement.plist 482B
bg_tableheader_64@2x.png 50KB
bg_tableheader@2x.png 32KB
bg_tableheader_64.png 28KB
bg_tableheader.png 23KB
Default-568h@2x.png 18KB
Default-568h@2x.png 18KB
disclosure.png 206B
disclosure.png 206B
disclosure_open.png 203B
disclosure_open.png 203B
library_background.png 160B
library_background.png 160B
button_bar_background.png 114B
button_bar_background.png 114B
title_background.png 109B
title_background.png 109B
PPRevealSideViewController.podspec 1KB
docSet.skidx 40KB
InfoPlist.strings 45B
InfoPlist.strings 45B
docSet.toc 535B
Breakpoints.xcbkptlist 91B
Breakpoints.xcbkptlist 91B
Breakpoints_v2.xcbkptlist 91B
PPRevealSideViewController.xcscheme 3KB
PPRevealSideViewController.xcscheme 3KB
PPRevealSideViewController.xcscheme 3KB
EasySample.xcscheme 3KB
BuildDocumentation.xcscheme 2KB
BuildDocumentation.xcscheme 2KB
BuildDocumentation.xcscheme 2KB
WorkspaceSettings.xcsettings 333B
共 116 条
- 1
- 2
资源评论
- 墨月棂枫2016-01-26非常感谢 非常好用
- 肖湘军2015-06-22很方便的工具。省了好多代码
- feng4744255272015-10-16很好用 就是太老了
- 黄花菜先生2015-10-30很好好,帮了我大忙
COCO_Jasmine
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功