quattro_4 scribble

scribble 落書き (調べた事をただ落書きする)

NSScreencast Episode #47 Gesture Recognizers

Gesture Recognizers - NSScreencast

tapした場所に画像を表示させる、移動、拡大縮小、回転

  • common
    • initWithTarget:self, action:@selector(onViewDoubleTap:)
    • [self.view addGestureRecognizer:tapRecognizer];
  • UITapGestureRecognizer
    • tapRecognizer.numberOfTapsRequired = 2;
    • onViewDoubleTap
      • CGPoint touchCenter = [tap locationInView:self.view];
  • effect
    • CGAffineTransformRotate(imageView.transform, angle);
    • animateWithDuration:0.25 animations
    • imageView.layer
      • .border
      • .shadow
      • shadowOpacity
    • CGMutablePathRef shadowPath = CGPathCreateMutable();
      • CGPathRelease(shadowPath);
  • UIPanGestureRecognizer
    • onPan
      • [pan translationInView:self.view];
      • pan.view.center;
    • pan=drag?
  • UIPinchGestureRecognizer
    • onPinch
      • CGFloat scale = [pinch scale];
      • [pinch setScale:1];
  • UIRotationGestureRecognizer
    • onRotate
      • CGFloat angle = [rotation rotation];
      • [rotation setRotation:0];
  • UISwipeGestureRecognizer
    • swipeRecognizer.direction = UISwipeGestureRecognizerDirectionDown;
  • simultaneous gestures
    • don't work together
      • pinch and rotate
      • swipe down and pan down
    • shouldRecognizeSimultaneouslyWithGestureRecognizer
    • pinchRecognizer.delegate = self;
    • gestureRecognizerShouldBegin
    • if ([gestureRecognizer isKindOfClass:[UISwipeGestureRecognizer class]]) {
  • simulator
    • option -> pinch
    • option + shift -> pinch and move