How to get a CGPoint from a tapped location?

后端 未结 6 1578
青春惊慌失措
青春惊慌失措 2020-12-01 06:32

I\'m working on a graphing calculator app for the iPad, and I wanted to add a feature where a user can tap an area in the graph view to make a text box pop up displaying the

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-01 06:48

    func handleFrontTap(gestureRecognizer: UITapGestureRecognizer) {
        print("tap working")
        if gestureRecognizer.state == UIGestureRecognizerState.Recognized { 
            `print(gestureRecognizer.locationInView(gestureRecognizer.view))`
        }
    }
    

提交回复
热议问题