listenzz / HBDNavigationBar

A custom UINavigationBar for smooth switching between various states, including bar style, bar tint color, background image, background alpha, bar hidden, title text attributes, tint color, shadow hidden...
MIT License
1.65k stars 215 forks source link

当hbd_swipeBackEnabled设置为NO时,用侧滑手势返回时,还可以响应重写hbd_backInteractive的方法 #131

Open Chaos1019 opened 4 years ago

Chaos1019 commented 4 years ago

这么做合理吗?是不是当hbd_swipeBackEnabled设置为NO时,用户侧滑返回是不是应该单纯的没有操作,而且不应该执行hbd_backInteractive的getter方法?

listenzz commented 4 years ago

有道理

Chaos1019 commented 4 years ago
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
    if (self.nav.viewControllers.count > 1) {
        return self.nav.topViewController.hbd_swipeBackEnabled && self.nav.topViewController.hbd_backInteractive;
    }
    return NO;
}

这里这么写是不是好一些?

listenzz commented 4 years ago

@Chaos1019 好,你要不要提个 PR

Chaos1019 commented 4 years ago

@Chaos1019 好,你要不要提个 PR

已经提了