Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Enables the option to set shadow color and shadow opacity #61

Merged
merged 1 commit into from

2 participants

Nate West Michael Frederick
Nate West

No description provided.

Michael Frederick

Looks good, when I have a chance to test it out I will merge it in.

Michael Frederick mikefrederick merged commit 9ba0b1f into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 20, 2013
  1. Nate West
This page is out of date. Refresh to see the latest.
Showing with 18 additions and 2 deletions.
  1. +2 −0  MFSideMenu/MFSideMenu.h
  2. +16 −2 MFSideMenu/MFSideMenu.m
2  MFSideMenu/MFSideMenu.h
View
@@ -39,6 +39,8 @@ typedef void (^MFSideMenuStateEventBlock)(MFSideMenuStateEvent);
@property (nonatomic, assign) BOOL shadowEnabled;
@property (nonatomic, assign) CGFloat menuWidth; // size of the side menu(s)
@property (nonatomic, assign) CGFloat shadowRadius; // radius of the shadow
+@property (nonatomic, assign) CGFloat shadowOpacity;
+@property (nonatomic, assign) CGColorRef shadowColor;
// this can be used to observe all MFSideMenuStateEvents
@property (copy) MFSideMenuStateEventBlock menuStateEventBlock;
18 MFSideMenu/MFSideMenu.m
View
@@ -42,6 +42,8 @@ @implementation MFSideMenu
@synthesize shadowEnabled = _shadowEnabled;
@synthesize menuWidth = _menuWidth;
@synthesize shadowRadius = _shadowRadius;
+@synthesize shadowColor = _shadowColor;
+@synthesize shadowOpacity = _shadowOpacity;
#pragma mark -
@@ -57,6 +59,8 @@ - (id) init {
self.menuState = MFSideMenuStateClosed;
self.menuWidth = 270.0f;
self.shadowRadius = 10.0f;
+ self.shadowOpacity = 0.75f;
+ self.shadowColor = [UIColor blackColor].CGColor;
}
return self;
}
@@ -173,14 +177,24 @@ - (void)setShadowRadius:(CGFloat)shadowRadius {
[self drawMenuShadows];
}
+- (void)setShadowColor:(CGColorRef)shadowColor {
+ _shadowColor = shadowColor;
+ [self drawMenuShadows];
+}
+
+- (void)setShadowOpacity:(CGFloat)shadowOpacity {
+ _shadowOpacity = shadowOpacity;
+ [self drawMenuShadows];
+}
+
- (void) drawMenuShadows {
if(_shadowEnabled) {
// we draw the shadow on the rootViewController, because it might not always be the uinavigationcontroller
// i.e. it could be a uitabbarcontroller
[self drawRootControllerShadowPath];
- self.rootViewController.view.layer.shadowOpacity = 0.75f;
+ self.rootViewController.view.layer.shadowOpacity = self.shadowOpacity;
self.rootViewController.view.layer.shadowRadius = self.shadowRadius;
- self.rootViewController.view.layer.shadowColor = [UIColor blackColor].CGColor;
+ self.rootViewController.view.layer.shadowColor = self.shadowColor;
}
}
Something went wrong with that request. Please try again.