Open JeeGee1983 opened 7 years ago
Have you fixed the bug with crash?
Same here. Could anyone fix this issue ?
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;
@JeeGee1983 My app still crash with above warning as you mentioned.
@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;
}
}
still not resolved!!!
@mrMash What's the exact problem you facing now?
its solved Thanks
Does not work for me.
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!