看板 MacDev 關於我們 聯絡資訊
又有問題來請教板上前輩, 問題如標題所示如何判斷pan手勢往左或往右 目前的想法是宣告了location物件取得座標x, CGPoint location = [sender locationInView:self.view]; [sender setTranslation:location inView:self.view]; if(loaction.x - currentlocaton.x == -1) { NSlog("left); }else{ NSlog("right); } 不知道這解法是否正確, 還有想請教前輩們如何取得判斷式裡currentlocaton.x的值呢? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.40.226.161 ※ 文章網址: https://www.ptt.cc/bbs/MacDev/M.1426168400.A.967.html ※ 編輯: yavis (114.40.226.161), 03/12/2015 21:58:26
darktt: -translationInView:就可以取得移動的矢量了 03/13 06:49
uranusjr: 「向量」 03/13 10:53