Skip to content

Commit

Permalink
iOS7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanoa committed Oct 22, 2013
1 parent 165b677 commit 9bbe3de
Show file tree
Hide file tree
Showing 79 changed files with 448 additions and 429 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ Version 1.3.0
* Fixed issues #86. The SASlideMenuDelegate changed in order to add the selected controller has a parameter on each method.
* Fixed issue #89. The SASlideMenuNavigationViewController now implements popToRootViewControllerAnimated:.

Version 2.0.0
* iOS7 support
* Modified all the sample icons to better suite iOS7


Binary file removed Icon.png
Binary file not shown.
Binary file removed Icon@2x.png
Binary file not shown.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

Created by **stefanoa**

A simple library to create sliding menus that can be used in storyboards and support static cells. Sliding menus are used in a number of popular applications like Facebook, Path 2.0, GMail, Glassboard and many others.
A simple library to create sliding menus that can be used in storyboards and support static cells. Sliding menus are used in a number of popular applications like Path 2.0, GMail, TechCrunch, Glassboard and many others.

The repository is an Xcode 4 project that contains two example of the usage of the library and the library itself.
The repository is an Xcode 4 project that contains three examples of the usage of the library and the library itself.

# Usage
You can use SASlide menu with both static cells and dynamic cell prototypes. In the project you will find two different target that use both type of cells to create a slide menu.
You can use SASlide menu with both static cells and dynamic cell prototypes. In the project you will find two different target that use both type of cells to create a slide menu. There is also an iPad app example

To use it in your project follow these steps:
* Add the SASlideMenu subdir and it's contents to your project
* Add a new class that inherits from **SASlideMenuViewController** and include/implement **SASlideMenuDataSource** and **SASlideMenuDelegate**.
Expand All @@ -31,9 +32,11 @@ Test it and you are done!

![Static](https://raw.github.com/stefanoa/SASlideMenu/master/SASlideMenu/Screenshot-Static-Menu.png)

![iPad](https://raw.github.com/stefanoa/SASlideMenu/master/SASlideMenu/Screenshot-iPad.png)

# Requirements

It needs iOS 5.1
It needs iOS 7.
# License

**SASlideMenu** is available under the MIT license:
Expand Down
6 changes: 3 additions & 3 deletions SASlideMenu.podspec
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Pod::Spec.new do |s|
s.name = 'SASlideMenu'
s.version = '1.3.2'
s.version = '2.0.0'
s.license = { :type => 'MIT', :file => 'README.md' }
s.summary = 'A simple library to create sliding menus that can be used in storyboards and support static cells.'
s.homepage = 'https://github.com/stefanoa/SASlideMenu'
s.author = 'Stefano Antonelli'

s.source = { :git => 'https://github.com/stefanoa/SASlideMenu.git', :tag => 'v1.3.2' }
s.source = { :git => 'https://github.com/stefanoa/SASlideMenu.git', :tag => 'v2.0.0' }

s.description = 'A simple library to create sliding menus that can be used in storyboards and support static cells.
Sliding menus are used in a number of popular applications like Facebook, Path 2.0, GMail, Glassboard and many others.'

s.platform = :ios, '6.1'
s.platform = :ios, '7.0'
s.source_files = 'SASlideMenu/SASlideMenu'

s.requires_arc = true
Expand Down
252 changes: 48 additions & 204 deletions SASlideMenu.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

20 changes: 4 additions & 16 deletions SASlideMenu/ExampleDynamicMenuViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ -(void)tap:(id)sender{

-(void) viewDidLoad{
[super viewDidLoad];
self.automaticallyAdjustsScrollViewInsets = NO;

}
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
return YES;
Expand All @@ -59,21 +57,13 @@ -(void) prepareForSwitchToContentViewController:(UINavigationController *)conten
// It configure the menu button. The beahviour of the button should not be modified
-(void) configureMenuButton:(UIButton *)menuButton{
menuButton.frame = CGRectMake(0, 0, 40, 29);
[menuButton setImage:[UIImage imageNamed:@"menuicon.png"] forState:UIControlStateNormal];
[menuButton setBackgroundImage:[UIImage imageNamed:@"menu.png"] forState:UIControlStateNormal];
[menuButton setBackgroundImage:[UIImage imageNamed:@"menuhighlighted.png"] forState:UIControlStateHighlighted];
[menuButton setAdjustsImageWhenHighlighted:NO];
[menuButton setAdjustsImageWhenDisabled:NO];
[menuButton setImage:[UIImage imageNamed:@"menuicon"] forState:UIControlStateNormal];
}

// It configure the right menu button. The beahviour of the button should not be modified
-(void) configureRightMenuButton:(UIButton *)menuButton{
menuButton.frame = CGRectMake(0, 0, 40, 29);
[menuButton setImage:[UIImage imageNamed:@"menuright.png"] forState:UIControlStateNormal];
[menuButton setBackgroundImage:[UIImage imageNamed:@"menu.png"] forState:UIControlStateNormal];
[menuButton setBackgroundImage:[UIImage imageNamed:@"menuhighlighted.png"] forState:UIControlStateHighlighted];
[menuButton setAdjustsImageWhenHighlighted:NO];
[menuButton setAdjustsImageWhenDisabled:NO];
[menuButton setImage:[UIImage imageNamed:@"menuiconright"] forState:UIControlStateNormal];
}

// This is the segue you want visibile when the controller is loaded the first time
Expand All @@ -99,12 +89,10 @@ -(NSString*) segueIdForIndexPath:(NSIndexPath *)indexPath{
return result;
}

//Disable caching for the controller at the first row of each section
-(Boolean) disableContentViewControllerCachingForIndexPath:(NSIndexPath *)indexPath{
return YES;
}

//Enable the right menu for the the view controller in the first section
-(Boolean) hasRightMenuForIndexPath:(NSIndexPath *)indexPath{
return YES;
}
Expand Down Expand Up @@ -149,11 +137,11 @@ -(UITableViewCell*) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NS
}

-(CGFloat) leftMenuVisibleWidth{
return 280;
return 260;
}

-(CGFloat) rightMenuVisibleWidth{
return 300;
return 260;
}

//restricts pan gesture interation to 50px on the left and right of the view.
Expand Down
15 changes: 4 additions & 11 deletions SASlideMenu/ExampleStaticMenuViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface

#pragma mark -
#pragma mark SASlideMenuDataSource
// The SASlideMenuDataSource is used to provide the initial segueid that represents the initial visibile view controller and to provide eventual additional configuration to the menu button

// This is the indexPath selected at start-up
-(NSIndexPath*) selectedIndexPath{
return [NSIndexPath indexPathForRow:0 inSection:0];
}
Expand All @@ -55,27 +53,22 @@ -(Boolean) disablePanGestureForIndexPath:(NSIndexPath *)indexPath{
return NO;
}

// This is used to configure the menu button. The beahviour of the button should not be modified
-(void) configureMenuButton:(UIButton *)menuButton{
menuButton.frame = CGRectMake(0, 0, 40, 29);
[menuButton setImage:[UIImage imageNamed:@"menuicon.png"] forState:UIControlStateNormal];
[menuButton setBackgroundImage:[UIImage imageNamed:@"menu.png"] forState:UIControlStateNormal];
[menuButton setBackgroundImage:[UIImage imageNamed:@"menuhighlighted.png"] forState:UIControlStateHighlighted];
[menuButton setAdjustsImageWhenHighlighted:NO];
[menuButton setAdjustsImageWhenDisabled:NO];
[menuButton setImage:[UIImage imageNamed:@"menuicon"] forState:UIControlStateNormal];
}

-(void) configureSlideLayer:(CALayer *)layer{
layer.shadowColor = [UIColor blackColor].CGColor;
layer.shadowOpacity = 0.3;
layer.shadowOffset = CGSizeMake(-15, 0);
layer.shadowRadius = 10;
layer.shadowOffset = CGSizeMake(-5, 0);
layer.shadowRadius = 5;
layer.masksToBounds = NO;
layer.shadowPath =[UIBezierPath bezierPathWithRect:layer.bounds].CGPath;
}

-(CGFloat) leftMenuVisibleWidth{
return 280;
return 260;
}
-(void) prepareForSwitchToContentViewController:(UINavigationController *)content{
UIViewController* controller = [content.viewControllers objectAtIndex:0];
Expand Down
Binary file removed SASlideMenu/Icon.png
Binary file not shown.
Binary file added SASlideMenu/Icon.psd
Binary file not shown.
Binary file removed SASlideMenu/Icon@2x.png
Binary file not shown.
102 changes: 102 additions & 0 deletions SASlideMenu/Images.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"images" : [
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon@29.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon@58.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon@80.png",
"scale" : "2x"
},
{
"size" : "57x57",
"idiom" : "iphone",
"filename" : "Icon@57.png",
"scale" : "1x"
},
{
"size" : "57x57",
"idiom" : "iphone",
"filename" : "Icon@114.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon@120.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon@29-1.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon@58-1.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon@40-1.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon@80-1.png",
"scale" : "2x"
},
{
"size" : "50x50",
"idiom" : "ipad",
"filename" : "Icon@50.png",
"scale" : "1x"
},
{
"size" : "50x50",
"idiom" : "ipad",
"filename" : "Icon@100.png",
"scale" : "2x"
},
{
"size" : "72x72",
"idiom" : "ipad",
"filename" : "Icon@72.png",
"scale" : "1x"
},
{
"size" : "72x72",
"idiom" : "ipad",
"filename" : "Icon@144.png",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions SASlideMenu/Images.xcassets/menuicon.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "MenuIcon.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "MenuIcon@2x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions SASlideMenu/Images.xcassets/menuiconright.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "MenuIconRight.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "MenuIconRight@2x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions SASlideMenu/Images.xcassets/rightrowcircle.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "RightRowCircle.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "RightRowCircle@2x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions SASlideMenu/Images.xcassets/rightrowsquare.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "RightRowSquare.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "RightRowSquare@2x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "RightRowTriangle.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "RightRowTriangle@2x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file added SASlideMenu/MenuIcon.psd
Diff not rendered.
Binary file added SASlideMenu/RightRow.psd
Diff not rendered.
2 changes: 1 addition & 1 deletion SASlideMenu/SASlideMenu/SASlideMenuContentSegue.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ -(void) perform{
CALayer* layer = destination.view.layer;
layer.shadowColor = [UIColor blackColor].CGColor;
layer.shadowOpacity = 0.3;
layer.shadowOffset = CGSizeMake(-15, 0);
layer.shadowOffset = CGSizeMake(-5, 0);
layer.shadowRadius = 10;
layer.masksToBounds = NO;
layer.shadowPath =[UIBezierPath bezierPathWithRect:layer.bounds].CGPath;
Expand Down
11 changes: 5 additions & 6 deletions SASlideMenu/SASlideMenu/SASlideMenuLeftMenuSegue.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ @implementation SASlideMenuLeftMenuSegue
-(void) perform{
SASlideMenuRootViewController* rootViewController = self.sourceViewController;
SASlideMenuViewController* leftMenu = self.destinationViewController;
CGRect bounds = rootViewController.view.bounds;
CGRect bounds = rootViewController.menuView.bounds;
leftMenu.view.frame = CGRectMake(0,0,bounds.size.width,bounds.size.height);

[leftMenu willMoveToParentViewController:rootViewController];
Expand All @@ -28,11 +28,10 @@ -(void) perform{
[leftMenu didMoveToParentViewController:rootViewController];
if ([rootViewController.leftMenu.slideMenuDataSource respondsToSelector:@selector(selectedIndexPath)]) {
NSIndexPath* selectedIndexPath = [rootViewController.leftMenu.slideMenuDataSource selectedIndexPath];
[leftMenu.tableView selectRowAtIndexPath:selectedIndexPath animated:NO scrollPosition:UITableViewScrollPositionTop];
NSString* initialSegueId = [rootViewController.leftMenu.slideMenuDataSource segueIdForIndexPath:selectedIndexPath];
[leftMenu performSegueWithIdentifier:initialSegueId sender:leftMenu];
}

if (selectedIndexPath) {
[leftMenu selectContentAtIndexPath:selectedIndexPath scrollPosition:UITableViewScrollPositionTop];
}
}
}

@end
Binary file modified SASlideMenu/Screenshot-Dynamic-Menu.png
Binary file modified SASlideMenu/Screenshot-Dynamic-Right.png
Binary file modified SASlideMenu/Screenshot-Landscape.png
Binary file removed SASlideMenu/Screenshot-Portrait.png
Diff not rendered.
Binary file modified SASlideMenu/Screenshot-Static-Menu.png
Binary file added SASlideMenu/Screenshot-iPad.png
Binary file removed SASlideMenu/disclosure.png
Diff not rendered.
Binary file removed SASlideMenu/disclosure@2x.png
Diff not rendered.
Binary file removed SASlideMenu/menu.png
Diff not rendered.
Binary file removed SASlideMenu/menu@2x.png
Diff not rendered.
Binary file removed SASlideMenu/menuhighlighted.png
Diff not rendered.
Binary file removed SASlideMenu/menuhighlighted@2x.png
Diff not rendered.
Binary file removed SASlideMenu/menuicon.png
Diff not rendered.
Binary file removed SASlideMenu/menuicon@2x.png
Diff not rendered.
Binary file removed SASlideMenu/menuright.png
Diff not rendered.
Binary file removed SASlideMenu/menuright@2x.png
Diff not rendered.
Binary file removed SASlideMenu/row.png
Diff not rendered.
Binary file removed SASlideMenu/row@2x.png
Diff not rendered.
Binary file removed SASlideMenu/rowcircle.png
Diff not rendered.
Binary file removed SASlideMenu/rowcircle@2x.png
Diff not rendered.
Binary file removed SASlideMenu/rowpenta.png
Diff not rendered.
Binary file removed SASlideMenu/rowpenta@2x.png
Diff not rendered.
Binary file removed SASlideMenu/rowpenta@@x.png
Diff not rendered.
Binary file removed SASlideMenu/rowselected.png
Diff not rendered.
Binary file removed SASlideMenu/rowselected@2x.png
Diff not rendered.
Binary file removed SASlideMenu/rowsquare.png
Diff not rendered.
Binary file removed SASlideMenu/rowsquare@2x.png
Diff not rendered.
Binary file removed SASlideMenu/selectedColoredRow.png
Diff not rendered.
Binary file removed SASlideMenu/selectedColoredRow.psd
Diff not rendered.
Binary file removed SASlideMenu/selectedColoredRow@2x.png
Diff not rendered.
Loading

0 comments on commit 9bbe3de

Please sign in to comment.