Monntay / CustomTabBarShape

Give the UITabBar a custom shape
98 stars 21 forks source link

Buttons and TableView Not interacting in CutsomTabBarShape #3

Closed osamainam777 closed 5 years ago

osamainam777 commented 5 years ago

I added buttons and TableViews inside the a ViewController than added it inside the customTabBar but there is an issue that not item inside tabController is interacting. I press button and try to scroll the tableViews but nothing is interacting with it. Can you help? Looking forward to hear from you Thanks

SpectreDevelopment commented 5 years ago

Add this to your Tab Bar Class

override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
        guard !clipsToBounds && !isHidden && alpha > 0 else { return nil }
        for member in subviews.reversed() {
            let subPoint = member.convert(point, from: self)
            guard let result = member.hitTest(subPoint, with: event) else { continue }
            return result
        }
        return nil
    }
osamainam777 commented 5 years ago

Works like charm. Thanks a bunch!!!!!