chenliangloveyou / EasyNavigation

一款超级简单的导航条管理工具。完全自定义导航条。没有UINavigationBar 和 UINavigationItem 这两个类。完全是对UIView的操作。
MIT License
397 stars 94 forks source link

请移除EasyNavigationController中对于-setTitle:的重写 #24

Open Hsukun opened 5 years ago

Hsukun commented 5 years ago

//- (void)setTitle:(NSString *)title //{ // if (self.topViewController.navigationView) { // [self.navigationView setTitle:title]; // } //}

或将 ‘ self.topViewController.navigationView’ 的判断条件改为:self.topViewController.navigationController, 因为self.topViewController 拿回来的可能是 UINavigationController,且当 navigationController 为空时,获取navigationView时就会被NSAssert拦截,此判断根本无效:

if (!self.navigationController) { NSAssert(NO, @"attention: this controller's navigationcontroller is null: %@",self); }