objective-c ジェスチャー
参考
UISwipeGestureRecognizer でスワイプでシュッと出して閉じるメニューのコードを公開しました – Zero4Racer PRO Developer's Blog
http://msc-jp.biz/material_html/terms_PAN.html
iPhoneで動くアプリを作ろう
タッチした位置が指定された範囲内かどうかを調べる - tchan0624の備忘録的な
[iPhone 開発メモ] 画像をドラッグする | Sun Limited Mt.
ものくろなりんご [iPhone][Objective-C]UIViewをタッチしながら動かす方法
いきついたソース
- (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event { startLocation.x = self.navigationController.view.frame.origin.x; } - (void) handlePanGesture:(UIPanGestureRecognizer*) sender { UIPanGestureRecognizer* pan = (UIPanGestureRecognizer*) sender; CGPoint location = [pan translationInView:self.view]; NSLog(@"pan m=%f, x=%f, y=%f", self.navigationController.view.frame.origin.x, location.x, location.y); //ドラッグ中の座標を使って移動 self.navigationController.view.transform = CGAffineTransformMakeTranslation(startLocation.x + location.x, 0); }
さらに最終的にいきついたソース
ジェスチャーのパンでやったほうがよい。