sirven que para over los inicio home gestos flotante desactivar como boton assistive iphone ios xcode ipad

over - para que sirven los gestos en el iphone



Vistas NavegaciĆ³n usando el gesto de deslizar (5)

¡Ciertamente! Simplemente configure su viewController para que sea UIGestureRecognizerDelegate y declare UISwipeGestureRecognizer *swipeLeftRecognizer; (también retener y sintetizar). Luego, en la implementación, configurar los reconocedores con

UIGestureRecognizer *recognizer; // RIGHT SWIPE recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:)]; [self.view addGestureRecognizer:recognizer]; [recognizer release]; // LEFT SWIPE recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:)]; self.swipeLeftRecognizer = (UISwipeGestureRecognizer *)recognizer; swipeLeftRecognizer.direction = UISwipeGestureRecognizerDirectionLeft; [self.view addGestureRecognizer:swipeLeftRecognizer]; self.swipeLeftRecognizer = (UISwipeGestureRecognizer *)recognizer; [recognizer release];

Luego dispara las acciones que quieras con el método.

- (void)handleSwipeFrom:(UISwipeGestureRecognizer *)recognizer { if (recognizer.direction == UISwipeGestureRecognizerDirectionLeft) { // load a different viewController } else { // load an even different viewController } }

Lo que haces aquí es específico para tu aplicación. Puede cambiar la selección de la barra de pestañas, saltar a través de un controlador de navegación, presentar una vista diferente de manera modal o simplemente hacer una simple diapositiva en transición.

¿Cómo puedo cambiar las vistas verticalmente con gestos de deslizamiento?


Añadiendo gestos en veloz.

func addSwipes() { // Left Swipe let swipeLeft = UISwipeGestureRecognizer(target: self, action: "swipeLeft:") swipeLeft.direction = .Left self.view.addGestureRecognizer(swipeLeft) // Right Swipe let swipeRight = UISwipeGestureRecognizer(target: self, action: "swipeRight:") swipeRight.direction = .Right self.view.addGestureRecognizer(swipeRight) } func swipeLeft(gestureRecognizer: UISwipeGestureRecognizer) { } func swipeRight(gestureRecognizer: UISwipeGestureRecognizer) { }


Encontré mi respuesta. Estoy publicando el código para su referencia. Gracias :-)

en viewDidLoad

UISwipeGestureRecognizer *swipeGesture = [[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipedScreendown:)] autorelease]; swipeGesture.numberOfTouchesRequired = 1; swipeGesture.direction = UISwipeGestureRecognizerDirectionDown; [m_pImageView addGestureRecognizer:swipeGesture];

Ahora

- (void)swipedScreendown:(UISwipeGestureRecognizer*) swipeGesture { m_pViewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; CATransition *transition = [CATransition animation]; transition.duration = 0.75; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; transition.type = kCATransitionPush; transition.subtype = kCATransitionFromBottom; transition.delegate = self; [self.view.layer addAnimation:transition forKey:nil]; [self.view addSubview:PadViewController.view]; }

Si necesita más aclaraciones por favor publique aquí.


Implementar esto

//........towards right Gesture recogniser for swiping.....// UISwipeGestureRecognizer *rightRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(rightSwipeHandle:)]; rightRecognizer.direction = UISwipeGestureRecognizerDirectionRight; [rightRecognizer setNumberOfTouchesRequired:1]; [urView addGestureRecognizer:rightRecognizer]; [rightRecognizer release]; //........towards left Gesture recogniser for swiping.....// UISwipeGestureRecognizer *leftRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(leftSwipeHandle:)]; leftRecognizer.direction = UISwipeGestureRecognizerDirectionLeft; [leftRecognizer setNumberOfTouchesRequired:1]; [urView addGestureRecognizer:leftRecognizer]; [leftRecognizer release];

Luego esto:

- (void)rightSwipeHandle:(UISwipeGestureRecognizer*)gestureRecognizer { //Do moving } - (void)leftSwipeHandle:(UISwipeGestureRecognizer*)gestureRecognizer { // do moving }


Para referencia PengOne, aquí está el código que mencionó en su comentario anterior. Lo guardé en mi Mac porque pensé que podría ser útil algún día ...: D

// Manual navigation push animation UIImage* image = [UIImage imageNamed:@"CurrentView"]; UIImageView* imageView = [[UIImageView alloc] initWithImage:image]; imageView.frame = self.view.bounds; [self.view addSubview:imageView]; [imageView release]; CATransition *transition = [CATransition animation]; transition.type = kCATransitionPush; transition.subtype = kCATransitionFromRight; [self.view.layer addAnimation:transition forKey:@"push-transition"];