Skip to content

Commit a94f32f

Browse files
committed
A complete rewrite, close romaonthego#24, close romaonthego#28, close romaonthego#32, close romaonthego#35
1 parent 7e75ab3 commit a94f32f

File tree

70 files changed

+1036
-1859
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1036
-1859
lines changed

Demo.gif

1.94 MB
Loading

README.md

+47-36
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
iOS 7 style side menu inspired by Dribbble shots ([first](http://dribbble.com/shots/1116265-Instasave-iPhone-App) and [second](http://dribbble.com/shots/1114754-Social-Feed-iOS7)).
44

5-
<img src="https://github.com/romaonthego/RESideMenu/raw/master/Screenshot.png" alt="RESideMenu Screenshot" width="400" height="480" />
6-
<img src="https://github.com/romaonthego/RESideMenu/raw/master/Demo.gif" alt="RESideMenu Screenshot" width="320" height="480" />
5+
<img src="https://github.com/romaonthego/RESideMenu/raw/master/Screenshot.png" alt="RESideMenu Screenshot" width="400" height="568" />
6+
<img src="https://github.com/romaonthego/RESideMenu/raw/master/Demo.gif" alt="RESideMenu Screenshot" width="320" height="568" />
77

88
## Requirements
9-
* Xcode 4.5 or higher
9+
* Xcode 5 or higher
1010
* Apple LLVM compiler
11-
* iOS 5.0 or higher
11+
* iOS 6.0 or higher
1212
* ARC
1313

1414
## Demo
@@ -20,7 +20,7 @@ Build and run the `RESideMenuExample` project in Xcode to see `RESideMenu` in ac
2020
### CocoaPods
2121

2222
The recommended approach for installating `RESideMenu` is via the [CocoaPods](http://cocoapods.org/) package manager, as it provides flexible dependency management and dead simple installation.
23-
For best results, it is recommended that you install via CocoaPods >= **0.15.2** using Git >= **1.8.0** installed via Homebrew.
23+
For best results, it is recommended that you install via CocoaPods >= **0.26.2** using Git >= **1.8.0** installed via Homebrew.
2424

2525
Install CocoaPods if not already available:
2626

@@ -41,7 +41,7 @@ Edit your Podfile and add RESideMenu:
4141

4242
``` bash
4343
platform :ios, '6.0'
44-
pod 'RESideMenu', '~> 2.0.2'
44+
pod 'RESideMenu', '~> 3.0'
4545
```
4646

4747
Install into your Xcode project:
@@ -64,47 +64,58 @@ All you need to do is drop `RESideMenu` files into your project, and add `#inclu
6464

6565
## Example Usage
6666

67+
In your AppDelegate's `- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions` create the view controller and assign content and menu view controllers.
68+
6769
``` objective-c
68-
RESideMenuItem *homeItem = [[RESideMenuItem alloc] initWithTitle:@"Home" action:^(RESideMenu *menu, RESideMenuItem *item) {
69-
[menu hide];
70-
71-
SecondViewController *secondViewController = [[SecondViewController alloc] init];
72-
secondViewController.title = item.title;
73-
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:secondViewController];
74-
75-
// Use displayContentController to switch between view controllers
76-
//
77-
[menu displayContentController:navigationController];
78-
}];
79-
RESideMenuItem *exploreItem = [[RESideMenuItem alloc] initWithTitle:@"Explore" action:^(RESideMenu *menu, RESideMenuItem *item) {
80-
[menu hide];
81-
}];
82-
83-
self.sideMenu = [[RESideMenu alloc] initWithItems:@[homeItem, exploreItem]];
84-
[self.sideMenu show];
70+
// Create content and menu controllers
71+
//
72+
DEMONavigationController *navigationController = [[DEMONavigationController alloc] initWithRootViewController:[[DEMOHomeViewController alloc] init]];
73+
DEMOMenuViewController *menuController = [[DEMOMenuViewController alloc] initWithStyle:UITableViewStylePlain];
74+
75+
// Create side menu controller
76+
//
77+
RESideMenu *sideMenuViewController = [[RESideMenu alloc] initWithContentViewController:navigationController menuViewController:menuViewController];
78+
sideMenuViewController.backgroundImage = [UIImage imageNamed:@"Stars"];
79+
80+
// Make it a root controller
81+
//
82+
self.window.rootViewController = sideMenuViewController;
83+
```
84+
85+
Present the view controller:
86+
87+
```objective-c
88+
[self.sideMenuViewController presentMenuViewController];
89+
```
90+
91+
## Storyboards Example
92+
93+
1. Create a subclass of `RESideMenu`. In this example we call it `DEMORootViewController`.
94+
2. In the Storyboard designate the root view's owner as `DEMORootViewController`.
95+
3. Make sure to `#import "RESideMenu.h"` in `DEMORootViewController.h`.
96+
4. Add more view controllers to your Storyboard, and give them identifiers "menuViewController" and "contentViewController". Note that in the new XCode the identifier is called "Storyboard ID" and can be found in the Identity inspector.
97+
5. Add a method `awakeFromNib` to `DEMORootViewController.m` with the following code:
98+
99+
```objective-c
100+
101+
- (void)awakeFromNib
102+
{
103+
self.contentViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"contentController"];
104+
self.menuViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"menuController"];
105+
}
106+
85107
```
86108

87109
## Customization
88110

89111
You can customize the following properties of `RESideMenu`:
90112

91113
``` objective-c
92-
@property (assign, readwrite, nonatomic) CGFloat verticalOffset;
93-
@property (assign, readwrite, nonatomic) CGFloat horizontalOffset;
94-
@property (assign, readwrite, nonatomic) CGFloat itemHeight;
95-
@property (strong, readwrite, nonatomic) UIFont *font;
96-
@property (strong, readwrite, nonatomic) UIColor *textColor;
97-
@property (strong, readwrite, nonatomic) UIColor *highlightedTextColor;
114+
@property (assign, readwrite, nonatomic) NSTimeInterval animationDuration;
98115
@property (strong, readwrite, nonatomic) UIImage *backgroundImage;
99-
@property (assign, readwrite, nonatomic) BOOL hideStatusBarArea;
116+
@property (assign, readwrite, nonatomic) BOOL panGestureEnabled;
100117
```
101118

102-
## Contributors
103-
104-
Sam Oakley ([@blork](https://github.com/blork))<br />
105-
Alexis Creuzot ([@kirualex](https://github.com/kirualex))<br />
106-
Marc Chambers ([@mchambers](https://github.com/mchambers))
107-
108119
## Contact
109120

110121
Roman Efimov

RESideMenu.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Pod::Spec.new do |s|
22
s.name = 'RESideMenu'
3-
s.version = '2.0.2'
3+
s.version = '3.0'
44
s.authors = { 'Roman Efimov' => '[email protected]' }
55
s.homepage = 'https://github.com/romaonthego/RESideMenu'
66
s.summary = 'iOS 7 style side menu.'
77
s.source = { :git => 'https://github.com/romaonthego/RESideMenu.git',
8-
:tag => '2.0.2' }
8+
:tag => '3.0' }
99
s.license = { :type => "MIT", :file => "LICENSE" }
1010

1111
s.platform = :ios, '6.0'

RESideMenu/AccelerationAnimation.h

-24
This file was deleted.

RESideMenu/AccelerationAnimation.m

-48
This file was deleted.

RESideMenu/Evaluate.h

-50
This file was deleted.

RESideMenu/Evaluate.m

-81
This file was deleted.

RESideMenu/REBackgroundView.h

-33
This file was deleted.

0 commit comments

Comments
 (0)