Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
322 views
in Technique[技术] by (71.8m points)

swift - Enable Touch for Tabbar specific UIViewController

How to enable touch for tabBaar specific UIViewcontroller

override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
    if let touch = touches.first {
        let currentPoint = touch.location(in: self.tabBarController?.viewControllers?.index(after: 1))
        if button.frame.contains(currentPoint){
            self.buttonAction(sender: button)
        }
    }
}

getting this error Type of expression is ambiguous without more context

when added

let currentPoint = touch.location(in: self.tabBar)

Touch actions showing in other UIViewController after pushing from UITabBarController

question from:https://stackoverflow.com/questions/66048046/enable-touch-for-tabbar-specific-uiviewcontroller

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...