Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slide Menu does not work well in IOS 11 #250

Open
JeeGee1983 opened this issue Sep 21, 2017 · 9 comments
Open

Slide Menu does not work well in IOS 11 #250

JeeGee1983 opened this issue Sep 21, 2017 · 9 comments

Comments

@JeeGee1983
Copy link

The - (void)setEnableShadow:(BOOL)enable method does not work in IOS 11.

It's a problem with self.view in this method.
self.view.layer.shadowColor = [UIColor darkGrayColor].CGColor;

*** Assertion failure in -[_UINavigationBarVisualProviderModernIOS _contentViewFittingHeight], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3694.4.18/_UINavigationBarVisualProviderModernIOS.m:544

Any idea how to solve this? Thanks!

@x3mall1986
Copy link

Have you fixed the bug with crash?

@alpmusti
Copy link

Same here. Could anyone fix this issue ?

@JeeGee1983
Copy link
Author

JeeGee1983 commented Sep 25, 2017

I'm still testing but until now it looks okay.

I added this code in - (void)viewWillLayoutSubviews:

- (void)viewWillLayoutSubviews
{
	[super viewWillLayoutSubviews];
 
for (UIView *aView in self.navigationBar.subviews)
    {
        if ([aView isKindOfClass:NSClassFromString(@"_UINavigationBarContentView")])
        {
            aView.frame = CGRectMake(0, 0, aView.frame.size.width, aView.frame.size.height);
          aView.clipsToBounds = YES;
        }
    }
   
//moved this from the `setup` function: 
    self.enableShadow = YES;
    self.enableSwipeGesture = YES;

@kuldeep13990
Copy link

@JeeGee1983 My app still crash with above warning as you mentioned.

@alpmusti
Copy link

alpmusti commented Oct 17, 2017

@kuldeep13990

Try this way :

- (void)setup
{
    [[NSUserDefaults standardUserDefaults] setObject:nil forKey:@"ssidName"];
    [[NSUserDefaults standardUserDefaults] synchronize];
	if (singletonInstance)
		NSLog(@"Singleton instance already exists. You can only instantiate one instance of SlideNavigationController. This could cause major issues");
	
	singletonInstance = self;
	
	self.menuRevealAnimationDuration = MENU_SLIDE_ANIMATION_DURATION;
	self.menuRevealAnimationOption = MENU_SLIDE_ANIMATION_OPTION;
}

- (void)viewWillLayoutSubviews
{
	[super viewWillLayoutSubviews];
	
	// Update shadow size of enabled
	if (self.enableShadow)
		self.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.bounds].CGPath;
    self.landscapeSlideOffset = self.view.frame.size.width/6;
    self.portraitSlideOffset = self.view.frame.size.width/6;
    self.panGestureSideOffset = 0;
    self.avoidSwitchingToSameClassViewController = YES;
    self.enableShadow = YES;
    self.enableSwipeGesture = NO;
    self.delegate = self;
    // When menu open we disable user interaction
    // When rotates we want to make sure that userInteraction is enabled again
    [self enableTapGestureToCloseMenu:NO];
    
    if (self.menuNeedsLayout)
    {
        [self updateMenuFrameAndTransformAccordingToOrientation];
        
        // Handle different horizontal/vertical slideOffset during rotation
        // On iOS below 8 we just close the menu, iOS8 handles rotation better so we support keepiong the menu open
        if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0") && [self isMenuOpen])
        {
            Menu menu = (self.horizontalLocation > 0) ? MenuLeft : MenuRight;
            [self openMenu:menu withDuration:0 andCompletion:nil];
        }
        
        self.menuNeedsLayout = NO;
    }
}

@mrMash
Copy link

mrMash commented Oct 23, 2017

still not resolved!!!

@shibbyy
Copy link

shibbyy commented Oct 23, 2017

@mrMash What's the exact problem you facing now?

@mrMash
Copy link

mrMash commented Oct 23, 2017

its solved Thanks

@signsi
Copy link

signsi commented Jan 31, 2018

Does not work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants