[問題] pan手勢判斷往左滑或往右滑
又有問題來請教板上前輩,
問題如標題所示如何判斷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
→
03/13 06:49, , 1F
03/13 06:49, 1F
→
03/13 10:53, , 2F
03/13 10:53, 2F
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章