From f4611a631be12b49a40b47c99c6e8a82d63c4336 Mon Sep 17 00:00:00 2001 From: Ilya Timofeev Date: Wed, 3 Sep 2014 12:52:59 +0400 Subject: [PATCH 01/13] UIView with REMenuItems replaced with UIScrollView to be able to scroll when items not fit to the screen --- REMenu/REMenu.m | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/REMenu/REMenu.m b/REMenu/REMenu.m index 7d0859d..71bd830 100644 --- a/REMenu/REMenu.m +++ b/REMenu/REMenu.m @@ -35,7 +35,7 @@ @interface REMenuItem () @interface REMenu () -@property (strong, readwrite, nonatomic) UIView *menuView; +@property (strong, readwrite, nonatomic) UIScrollView *menuView; @property (strong, readwrite, nonatomic) UIView *menuWrapperView; @property (strong, readwrite, nonatomic) REMenuContainerView *containerView; @property (strong, readwrite, nonatomic) UIButton *backgroundButton; @@ -43,6 +43,7 @@ @interface REMenu () @property (assign, readwrite, nonatomic) BOOL isAnimating; @property (strong, readwrite, nonatomic) NSMutableArray *itemViews; @property (weak, readwrite, nonatomic) UINavigationBar *navigationBar; +@property (weak, readwrite, nonatomic) UIView *viewToShowFrom; @property (strong, readwrite, nonatomic) UIToolbar *toolbar; @end @@ -115,7 +116,9 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view self.isOpen = YES; self.isAnimating = YES; - + + self.viewToShowFrom = view; + // Create views // self.containerView = ({ @@ -129,9 +132,9 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view } view; }); - + self.menuView = ({ - UIView *view = [[UIView alloc] init]; + UIScrollView *view = [[UIScrollView alloc] init]; if (!self.liveBlur || !REUIKitIsFlatMode()) { view.backgroundColor = self.backgroundColor; } @@ -222,8 +225,11 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view // Set up frames // self.menuWrapperView.frame = CGRectMake(0, -self.combinedHeight - navigationBarOffset, rect.size.width, self.combinedHeight + navigationBarOffset); - self.menuView.frame = self.menuWrapperView.bounds; - if (REUIKitIsFlatMode() && self.liveBlur) { + CGFloat height = MIN(self.viewToShowFrom.bounds.size.height, self.combinedHeight) + navigationBarOffset; + self.menuView.frame = CGRectMake(0, 0, self.viewToShowFrom.bounds.size.width, height); + self.menuView.contentSize = CGSizeMake(rect.size.width, self.combinedHeight + navigationBarOffset); + + if (REUIKitIsFlatMode() && self.liveBlur) { self.toolbar.frame = self.menuWrapperView.bounds; } self.containerView.frame = CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); @@ -284,6 +290,19 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view self.isAnimating = NO; }]; } + + [[NSNotificationCenter defaultCenter] + addObserver:self + selector:@selector(updateViewOnRotate:) + name:UIDeviceOrientationDidChangeNotification + object:nil]; +} + +-(void) updateViewOnRotate:(NSNotification*) notification { + CGFloat navigationBarOffset = self.appearsBehindNavigationBar && self.navigationBar ? 64 : 0; + CGFloat height = MIN(self.viewToShowFrom.bounds.size.height, self.combinedHeight) + navigationBarOffset; + self.menuView.frame = CGRectMake(0, 0, self.viewToShowFrom.bounds.size.width, height); + self.menuView.contentSize = CGSizeMake(self.viewToShowFrom.bounds.size.width, self.combinedHeight + navigationBarOffset); } - (void)showInView:(UIView *)view @@ -311,7 +330,9 @@ - (void)closeWithCompletion:(void (^)(void))completion if (self.isAnimating) return; self.isAnimating = YES; - + + [[NSNotificationCenter defaultCenter] removeObserver:self]; + CGFloat navigationBarOffset = self.appearsBehindNavigationBar && self.navigationBar ? 64 : 0; void (^closeMenu)(void) = ^{ From b34d5c0033a65d09e4c28a979e6cd4b2256c46d2 Mon Sep 17 00:00:00 2001 From: Ilya Timofeev Date: Thu, 25 Sep 2014 10:25:57 +0400 Subject: [PATCH 02/13] UIView with REMenuItems replaced with UIScrollView to be able to scroll when items not fit to the screen --- REMenu/REMenu.m | 40 ++++++++++++++-------------- REMenu/REMenuContainerView.h | 33 ----------------------- REMenu/REMenuContainerView.m | 51 ------------------------------------ 3 files changed, 21 insertions(+), 103 deletions(-) delete mode 100644 REMenu/REMenuContainerView.h delete mode 100644 REMenu/REMenuContainerView.m diff --git a/REMenu/REMenu.m b/REMenu/REMenu.m index 71bd830..eeb0f14 100644 --- a/REMenu/REMenu.m +++ b/REMenu/REMenu.m @@ -37,7 +37,7 @@ @interface REMenu () @property (strong, readwrite, nonatomic) UIScrollView *menuView; @property (strong, readwrite, nonatomic) UIView *menuWrapperView; -@property (strong, readwrite, nonatomic) REMenuContainerView *containerView; +@property (strong, readwrite, nonatomic) UIView *containerView; @property (strong, readwrite, nonatomic) UIButton *backgroundButton; @property (assign, readwrite, nonatomic) BOOL isOpen; @property (assign, readwrite, nonatomic) BOOL isAnimating; @@ -122,7 +122,7 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view // Create views // self.containerView = ({ - REMenuContainerView *view = [[REMenuContainerView alloc] init]; + UIView *view = [[UIView alloc] init]; view.clipsToBounds = YES; view.autoresizingMask = UIViewAutoresizingFlexibleWidth; @@ -186,8 +186,6 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view button; }); - CGFloat navigationBarOffset = self.appearsBehindNavigationBar && self.navigationBar ? 64 : 0; - // Append new item views to REMenuView // for (REMenuItem *item in self.items) { @@ -198,7 +196,7 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view itemHeight += self.cornerRadius; UIView *separatorView = [[UIView alloc] initWithFrame:CGRectMake(self.separatorOffset.width, - index * self.itemHeight + index * self.separatorHeight + 40.0 + navigationBarOffset + self.separatorOffset.height, + index * self.itemHeight + index * self.separatorHeight + self.separatorOffset.height, rect.size.width - self.separatorOffset.width, self.separatorHeight)]; separatorView.backgroundColor = self.separatorColor; @@ -206,7 +204,7 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view [self.menuView addSubview:separatorView]; REMenuItemView *itemView = [[REMenuItemView alloc] initWithFrame:CGRectMake(0, - index * self.itemHeight + (index + 1.0) * self.separatorHeight + 40.0 + navigationBarOffset, + index * self.itemHeight + (index + 1.0) * self.separatorHeight, rect.size.width, itemHeight) menu:self item:item @@ -221,13 +219,13 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view } [self.menuView addSubview:itemView]; } - + // Set up frames // - self.menuWrapperView.frame = CGRectMake(0, -self.combinedHeight - navigationBarOffset, rect.size.width, self.combinedHeight + navigationBarOffset); - CGFloat height = MIN(self.viewToShowFrom.bounds.size.height, self.combinedHeight) + navigationBarOffset; + self.menuWrapperView.frame = CGRectMake(0, -self.combinedHeight, self.viewToShowFrom.bounds.size.width, self.combinedHeight); + CGFloat height = MIN(self.viewToShowFrom.bounds.size.height - self.navigationBarOffset, self.combinedHeight); self.menuView.frame = CGRectMake(0, 0, self.viewToShowFrom.bounds.size.width, height); - self.menuView.contentSize = CGSizeMake(rect.size.width, self.combinedHeight + navigationBarOffset); + self.menuView.contentSize = CGSizeMake(self.viewToShowFrom.bounds.size.width, self.combinedHeight); if (REUIKitIsFlatMode() && self.liveBlur) { self.toolbar.frame = self.menuWrapperView.bounds; @@ -258,7 +256,7 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view animations:^{ self.backgroundView.alpha = self.backgroundAlpha; CGRect frame = self.menuView.frame; - frame.origin.y = -40.0 - self.separatorHeight; + frame.origin.y = self.navigationBarOffset; self.menuWrapperView.frame = frame; } completion:^(BOOL finished) { self.isAnimating = NO; @@ -270,7 +268,7 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view animations:^{ self.backgroundView.alpha = self.backgroundAlpha; CGRect frame = self.menuView.frame; - frame.origin.y = -40.0 - self.separatorHeight; + frame.origin.y = self.navigationBarOffset; self.menuWrapperView.frame = frame; } completion:^(BOOL finished) { self.isAnimating = NO; @@ -284,7 +282,7 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view animations:^{ self.backgroundView.alpha = self.backgroundAlpha; CGRect frame = self.menuView.frame; - frame.origin.y = -40.0 - self.separatorHeight; + frame.origin.y = self.navigationBarOffset; self.menuWrapperView.frame = frame; } completion:^(BOOL finished) { self.isAnimating = NO; @@ -298,11 +296,17 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view object:nil]; } +-(CGFloat) navigationBarOffset { + CGFloat statusBarHeight = MIN([[UIApplication sharedApplication] statusBarFrame].size.width, [[UIApplication sharedApplication] statusBarFrame].size.height); + + return self.navigationBar ? self.navigationBar.frame.size.height + statusBarHeight : 0; +} + -(void) updateViewOnRotate:(NSNotification*) notification { - CGFloat navigationBarOffset = self.appearsBehindNavigationBar && self.navigationBar ? 64 : 0; - CGFloat height = MIN(self.viewToShowFrom.bounds.size.height, self.combinedHeight) + navigationBarOffset; + CGFloat height = MIN(self.viewToShowFrom.bounds.size.height - self.navigationBarOffset, self.combinedHeight); self.menuView.frame = CGRectMake(0, 0, self.viewToShowFrom.bounds.size.width, height); - self.menuView.contentSize = CGSizeMake(self.viewToShowFrom.bounds.size.width, self.combinedHeight + navigationBarOffset); + self.menuView.contentSize = CGSizeMake(self.viewToShowFrom.bounds.size.width, self.combinedHeight); + self.menuWrapperView.frame = CGRectMake(0, self.navigationBarOffset, self.viewToShowFrom.bounds.size.width, height); } - (void)showInView:(UIView *)view @@ -318,8 +322,6 @@ - (void)showFromNavigationController:(UINavigationController *)navigationControl self.navigationBar = navigationController.navigationBar; [self showFromRect:CGRectMake(0, 0, navigationController.navigationBar.frame.size.width, navigationController.view.frame.size.height) inView:navigationController.view]; - self.containerView.appearsBehindNavigationBar = self.appearsBehindNavigationBar; - self.containerView.navigationBar = navigationController.navigationBar; if (self.appearsBehindNavigationBar) { [navigationController.view bringSubviewToFront:navigationController.navigationBar]; } @@ -389,7 +391,7 @@ - (void)close - (CGFloat)combinedHeight { - return self.items.count * self.itemHeight + self.items.count * self.separatorHeight + 40.0 + self.cornerRadius; + return self.items.count * self.itemHeight + self.items.count * self.separatorHeight + self.cornerRadius; } - (void)setNeedsLayout diff --git a/REMenu/REMenuContainerView.h b/REMenu/REMenuContainerView.h deleted file mode 100644 index 47f3492..0000000 --- a/REMenu/REMenuContainerView.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// REMenuContainerView.h -// REMenu -// -// Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#import - -@interface REMenuContainerView : UIView - -@property (strong, readwrite, nonatomic) UINavigationBar *navigationBar; -@property (assign, readwrite, nonatomic) BOOL appearsBehindNavigationBar; - -@end diff --git a/REMenu/REMenuContainerView.m b/REMenu/REMenuContainerView.m deleted file mode 100644 index ce5e9a5..0000000 --- a/REMenu/REMenuContainerView.m +++ /dev/null @@ -1,51 +0,0 @@ -// -// REMenuContainerView.m -// REMenu -// -// Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#import "REMenuContainerView.h" -#import - -@implementation REMenuContainerView - -- (void)layoutSubviews -{ - [super layoutSubviews]; - UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; - - CGFloat landscapeOffset = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ? 32.0 : 44.0; - - if (self.navigationBar && !self.appearsBehindNavigationBar) { - CGRect frame = self.frame; - frame.origin.y = self.navigationBar.frame.origin.y + (UIDeviceOrientationIsPortrait(orientation) ? 44.0 : landscapeOffset); - self.frame = frame; - } - - if (self.appearsBehindNavigationBar) { - CGRect frame = self.frame; - frame.origin.y = (UIDeviceOrientationIsPortrait(orientation) ? 44.0 : landscapeOffset) - 44; - self.frame = frame; - } -} - -@end From 74235c3aa8ea020e784e90c815597a204df0fb31 Mon Sep 17 00:00:00 2001 From: Andrew Ng Date: Fri, 3 Oct 2014 16:13:05 -0700 Subject: [PATCH 03/13] Fixed nav bar offset calculation when status bar is hidden --- REMenu/RECommonFunctions.m | 0 REMenu/REMenu.m | 13 +++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) mode change 100755 => 100644 REMenu/RECommonFunctions.m diff --git a/REMenu/RECommonFunctions.m b/REMenu/RECommonFunctions.m old mode 100755 new mode 100644 diff --git a/REMenu/REMenu.m b/REMenu/REMenu.m index 9d0c367..9b1ed54 100644 --- a/REMenu/REMenu.m +++ b/REMenu/REMenu.m @@ -184,7 +184,7 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view button; }); - CGFloat navigationBarOffset = self.appearsBehindNavigationBar && self.navigationBar ? 64 : 0; + CGFloat navigationBarOffset = [self computeNavigationBarOffset]; // Append new item views to REMenuView // @@ -325,9 +325,8 @@ - (void)closeWithCompletion:(void (^)(void))completion if (self.isAnimating) return; self.isAnimating = YES; - - CGFloat navigationBarOffset = self.appearsBehindNavigationBar && self.navigationBar ? 64 : 0; - + CGFloat navigationBarOffset = [self computeNavigationBarOffset]; + void (^closeMenu)(void) = ^{ [UIView animateWithDuration:self.closeAnimationDuration delay:0.0 @@ -417,4 +416,10 @@ - (UIImage *)separatorImage return [UIImage imageWithCGImage:outputImage.CGImage scale:2.0 orientation:UIImageOrientationUp]; } +- (CGFloat)computeNavigationBarOffset +{ + CGFloat navigationBarOffset = self.appearsBehindNavigationBar && self.navigationBar ? ([UIApplication sharedApplication].statusBarHidden ? 44 : 64) : 0; + return navigationBarOffset; +} + @end From 821149752bbdce08c9a939ffa317ca44e2549f65 Mon Sep 17 00:00:00 2001 From: kineticac Date: Thu, 8 Jan 2015 15:34:19 -0800 Subject: [PATCH 04/13] Adding padding to the top of the remenu --- REMenu/REMenuItemView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/REMenu/REMenuItemView.m b/REMenu/REMenuItemView.m index baaf72d..c89c054 100644 --- a/REMenu/REMenuItemView.m +++ b/REMenu/REMenuItemView.m @@ -165,7 +165,7 @@ - (void)layoutSubviews self.subtitleLabel.shadowOffset = self.item.subtitleTextShadowOffset.width == 0 && self.item.subtitleTextShadowOffset.height == 0 ? self.menu.subtitleTextShadowOffset : self.item.subtitleTextShadowOffset; self.subtitleLabel.textAlignment = (NSInteger)self.item.subtitleTextAlignment == -1 ? self.menu.subtitleTextAlignment : self.item.subtitleTextAlignment; - self.item.customView.frame = CGRectMake(0, 0, self.titleLabel.frame.size.width, self.frame.size.height); + self.item.customView.frame = CGRectMake(0, 12, self.titleLabel.frame.size.width, self.frame.size.height); } - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event From be7252a07422b0caf07033f137d0169084fc6b26 Mon Sep 17 00:00:00 2001 From: kineticac Date: Thu, 8 Jan 2015 15:48:12 -0800 Subject: [PATCH 05/13] Creating a contentInset for the scroll view to add padding to the top of the menu. --- README.md | 1 + REMenu/REMenu.h | 1 + REMenu/REMenu.m | 1 + REMenu/REMenuItemView.m | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3d6d097..c2025aa 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,7 @@ REMenuItem *customViewItem = [[REMenuItem alloc] initWithCustomView:customView a You can customize the following properties of `REMenu`: ``` objective-c +@property (assign, readwrite, nonatomic) UIEdgeInsetsMake contentInset; @property (assign, readwrite, nonatomic) CGFloat cornerRadius; @property (strong, readwrite, nonatomic) UIColor *shadowColor; @property (assign, readwrite, nonatomic) CGSize shadowOffset; diff --git a/REMenu/REMenu.h b/REMenu/REMenu.h index ef3707f..4de24fe 100644 --- a/REMenu/REMenu.h +++ b/REMenu/REMenu.h @@ -66,6 +66,7 @@ typedef NS_ENUM(NSInteger, REMenuLiveBackgroundStyle) { // Style // +@property (assign, readwrite, nonatomic) UIEdgeInsetsMake contentInset; @property (assign, readwrite, nonatomic) CGFloat cornerRadius; @property (strong, readwrite, nonatomic) UIColor *shadowColor; @property (assign, readwrite, nonatomic) CGSize shadowOffset; diff --git a/REMenu/REMenu.m b/REMenu/REMenu.m index bbc1e7b..21363ca 100644 --- a/REMenu/REMenu.m +++ b/REMenu/REMenu.m @@ -146,6 +146,7 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view view.layer.shouldRasterize = YES; view.layer.rasterizationScale = [UIScreen mainScreen].scale; view.autoresizingMask = UIViewAutoresizingFlexibleWidth; + view.contentInset = self.contentInset; view; }); diff --git a/REMenu/REMenuItemView.m b/REMenu/REMenuItemView.m index c89c054..baaf72d 100644 --- a/REMenu/REMenuItemView.m +++ b/REMenu/REMenuItemView.m @@ -165,7 +165,7 @@ - (void)layoutSubviews self.subtitleLabel.shadowOffset = self.item.subtitleTextShadowOffset.width == 0 && self.item.subtitleTextShadowOffset.height == 0 ? self.menu.subtitleTextShadowOffset : self.item.subtitleTextShadowOffset; self.subtitleLabel.textAlignment = (NSInteger)self.item.subtitleTextAlignment == -1 ? self.menu.subtitleTextAlignment : self.item.subtitleTextAlignment; - self.item.customView.frame = CGRectMake(0, 12, self.titleLabel.frame.size.width, self.frame.size.height); + self.item.customView.frame = CGRectMake(0, 0, self.titleLabel.frame.size.width, self.frame.size.height); } - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event From 2448ad6fb822b8c54ae0b1c4b2d582639f0b7ecf Mon Sep 17 00:00:00 2001 From: kineticac Date: Thu, 8 Jan 2015 15:49:24 -0800 Subject: [PATCH 06/13] Bumping version --- REMenu.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/REMenu.podspec b/REMenu.podspec index c40ae9e..6d007bf 100644 --- a/REMenu.podspec +++ b/REMenu.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'REMenu' - s.version = '1.10' + s.version = '1.11' s.authors = { 'Roman Efimov' => 'romefimov@gmail.com' } s.homepage = 'https://github.com/romaonthego/REMenu' s.summary = 'Dropdown menu inspired by Vine.' From 859c407d5b49021a2f4aeffeeddf36ce78e58c62 Mon Sep 17 00:00:00 2001 From: kineticac Date: Thu, 8 Jan 2015 15:57:58 -0800 Subject: [PATCH 07/13] Need to use UIEdgeInsets as the type for the contentInset. --- REMenu/REMenu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/REMenu/REMenu.h b/REMenu/REMenu.h index 4de24fe..834ba2b 100644 --- a/REMenu/REMenu.h +++ b/REMenu/REMenu.h @@ -66,7 +66,7 @@ typedef NS_ENUM(NSInteger, REMenuLiveBackgroundStyle) { // Style // -@property (assign, readwrite, nonatomic) UIEdgeInsetsMake contentInset; +@property (assign, readwrite, nonatomic) UIEdgeInsets contentInset; @property (assign, readwrite, nonatomic) CGFloat cornerRadius; @property (strong, readwrite, nonatomic) UIColor *shadowColor; @property (assign, readwrite, nonatomic) CGSize shadowOffset; From cfb153041f566025af406859030cf3b28bd3ff5d Mon Sep 17 00:00:00 2001 From: kineticac Date: Thu, 8 Jan 2015 16:04:44 -0800 Subject: [PATCH 08/13] Adding a setter for the contentInset. --- REMenu/REMenu.m | 1 + 1 file changed, 1 insertion(+) diff --git a/REMenu/REMenu.m b/REMenu/REMenu.m index 21363ca..44ec24c 100644 --- a/REMenu/REMenu.m +++ b/REMenu/REMenu.m @@ -60,6 +60,7 @@ - (id)init _separatorHeight = 2.0; _separatorOffset = CGSizeMake(0.0, 0.0); _waitUntilAnimationIsComplete = YES; + _contentInset = UIEdgeInsetsMake(0.0, 0.0, 0.0, 0.0) _textOffset = CGSizeMake(0, 0); _subtitleTextOffset = CGSizeMake(0, 0); From 1779a0739eed4c13371aa83439cd4d5f0c279e04 Mon Sep 17 00:00:00 2001 From: kineticac Date: Thu, 8 Jan 2015 16:18:30 -0800 Subject: [PATCH 09/13] Semicolon missing, objectiv c yay --- REMenu/REMenu.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/REMenu/REMenu.m b/REMenu/REMenu.m index 44ec24c..63cb21f 100644 --- a/REMenu/REMenu.m +++ b/REMenu/REMenu.m @@ -60,7 +60,7 @@ - (id)init _separatorHeight = 2.0; _separatorOffset = CGSizeMake(0.0, 0.0); _waitUntilAnimationIsComplete = YES; - _contentInset = UIEdgeInsetsMake(0.0, 0.0, 0.0, 0.0) + _contentInset = UIEdgeInsetsMake(0.0, 0.0, 0.0, 0.0); _textOffset = CGSizeMake(0, 0); _subtitleTextOffset = CGSizeMake(0, 0); From 522bce391449d7250e7df91dd240577ecec8030e Mon Sep 17 00:00:00 2001 From: kineticac Date: Thu, 8 Jan 2015 16:27:22 -0800 Subject: [PATCH 10/13] property strong --- REMenu/REMenu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/REMenu/REMenu.h b/REMenu/REMenu.h index 834ba2b..9a78eba 100644 --- a/REMenu/REMenu.h +++ b/REMenu/REMenu.h @@ -66,7 +66,7 @@ typedef NS_ENUM(NSInteger, REMenuLiveBackgroundStyle) { // Style // -@property (assign, readwrite, nonatomic) UIEdgeInsets contentInset; +@property (strong, readwrite, nonatomic) UIEdgeInsets *contentInset; @property (assign, readwrite, nonatomic) CGFloat cornerRadius; @property (strong, readwrite, nonatomic) UIColor *shadowColor; @property (assign, readwrite, nonatomic) CGSize shadowOffset; From 9d4379ebf0cec36d45ff5089774bc37096aceaa9 Mon Sep 17 00:00:00 2001 From: kineticac Date: Thu, 8 Jan 2015 16:53:43 -0800 Subject: [PATCH 11/13] Moving it back to assignment prototype. --- REMenu/REMenu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/REMenu/REMenu.h b/REMenu/REMenu.h index 9a78eba..834ba2b 100644 --- a/REMenu/REMenu.h +++ b/REMenu/REMenu.h @@ -66,7 +66,7 @@ typedef NS_ENUM(NSInteger, REMenuLiveBackgroundStyle) { // Style // -@property (strong, readwrite, nonatomic) UIEdgeInsets *contentInset; +@property (assign, readwrite, nonatomic) UIEdgeInsets contentInset; @property (assign, readwrite, nonatomic) CGFloat cornerRadius; @property (strong, readwrite, nonatomic) UIColor *shadowColor; @property (assign, readwrite, nonatomic) CGSize shadowOffset; From 1242b57b7bb73ac1317bd3b7466ab5f463d8138e Mon Sep 17 00:00:00 2001 From: kineticac Date: Thu, 8 Jan 2015 16:56:19 -0800 Subject: [PATCH 12/13] Commenting on what contentInset does --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c2025aa..588b276 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ REMenuItem *customViewItem = [[REMenuItem alloc] initWithCustomView:customView a You can customize the following properties of `REMenu`: ``` objective-c -@property (assign, readwrite, nonatomic) UIEdgeInsetsMake contentInset; +@property (assign, readwrite, nonatomic) UIEdgeInsetsMake contentInset; //padding for the menu @property (assign, readwrite, nonatomic) CGFloat cornerRadius; @property (strong, readwrite, nonatomic) UIColor *shadowColor; @property (assign, readwrite, nonatomic) CGSize shadowOffset; From f7a4020d134cc894624d1bb5399c2c2a3c19267e Mon Sep 17 00:00:00 2001 From: Andrew Ng Date: Mon, 12 Jan 2015 12:18:54 -0800 Subject: [PATCH 13/13] back to 1.10 pod version --- REMenu.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/REMenu.podspec b/REMenu.podspec index 6d007bf..c40ae9e 100644 --- a/REMenu.podspec +++ b/REMenu.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'REMenu' - s.version = '1.11' + s.version = '1.10' s.authors = { 'Roman Efimov' => 'romefimov@gmail.com' } s.homepage = 'https://github.com/romaonthego/REMenu' s.summary = 'Dropdown menu inspired by Vine.'