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

swift中如何友好的拦截侧滑手势或者点击事件 #123

Open weileiming opened 4 years ago

weileiming commented 4 years ago

在swift中使用时 hbd_backInteractive 等属性是一个存储属性,无法简单通过重写属性实现拦截。可否有其他友好的方式进行拦截处理事件。

信息如下 Cannot override mutable property with read-only property 'hbd_backInteractive'

Yannmm commented 4 years ago

Here is a workaround:

override var hbd_backInteractive: Bool {
        get {
            onPopBack?()
            return true
        }
        set {
            super.hbd_backInteractive = newValue
        }
    }