문제

Hey, 사용자의 위치를 화면에 3 개의 스 와이프 할 수 있도록 스 와이프 할 수 있도록 스 와이프하여 스 와이프의 Y 좌표를 기반으로하는 섹션을 결정할 수 있습니다.

코드

CGPoint touchPoint = [recognizer locationOfTouch:0 inView:nil];
.

나는 TouchPoint를 인쇄하려고 시도했습니다. 레이블에서 모든 것이 0입니다. 사용자의 좌표를 어떻게 사용합니까?

감사합니다.

도움이 되었습니까?

해결책

Its strange but setting view as nil or self.view.window is returning 0. There is no mention of such behavior and Apple doc on UISwipeGestureRecognizer seems to encourage finding the origin of the swipe using this method. It would be a good idea to file this under a bug.

This is working for other views though. Say self.view.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top