2

currently I am moving uiviews from left to right on the swipe gesture of down how can I change transition to up and down

-(void)slideToRightWithGestureRecognizer:(UISwipeGestureRecognizer *)gestureRecognizer
{
[UIView animateWithDuration:0.5 animations:^{
    self.calendar.frame = CGRectOffset(self.calendar.frame, 320.0, 0.0);
    self.secondCalender.frame = CGRectOffset(self.secondCalender.frame, 320.0, 0.0);
}];
}
krushnsinh
  • 874
  • 1
  • 10
  • 11
user5276912
  • 131
  • 1
  • 1
  • 8

1 Answers1

0

The last parameter in CGRectOffset is the vertical offset. Pass a non-zero value in that and you'll move the view up/down.

/* Offset `rect' by `(dx, dy)'. */

CGRect CGRectOffset(CGRect rect, CGFloat dx, CGFloat dy)
rounak
  • 9,217
  • 3
  • 42
  • 59