I want to change view controllers by swiping controller like i when i swipe the message box should swipe from ViewController1->ViewController2 and from viewController1<-viewController2 i know i have to use UISwipeGestureRecognizer
or may be UIScrollView
or UIPageController
with contents of ViewControllers not Views. like default messageViewController swipe to EmailViewController or EmailViewController to MessageViewController. is there any idea how to do like this?
Asked
Active
Viewed 960 times
-3

Janak Nirmal
- 22,706
- 18
- 63
- 99

Hrushikesh Betai
- 2,227
- 5
- 33
- 63
1 Answers
1
- (void)goToNext{
//your code to load youn next view controller
}
- (void)goToBack{
//your code to load your previous view controller
}
- (void)viewDidLoad{
[super viewDidLoad];
UISwipeGestureRecognizer *recognizer;
recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(goToNext)];
[recognizer setDirection:(UISwipeGestureRecognizerDirectionRight)];
[[self view] addGestureRecognizer:recognizer];
[recognizer release];
recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(goToBack)];
[recognizer setDirection:(UISwipeGestureRecognizerDirectionUp)];
[[self view] addGestureRecognizer:recognizer];
[recognizer release];
}

John Smith
- 2,012
- 1
- 21
- 33
-
thank you. i know this but this will change the view controller like changing the pages in iphone. – Hrushikesh Betai Jul 16 '12 at 11:34
-
and what exactly you want to do? – John Smith Jul 16 '12 at 12:49
-
plz download `mobli` app and check in that they are changing viewControllers by swiping Feed->Me->Popular->etc... i want to do some thing like this but i want to change the views of iPhone Message->Email MessageController by swiping. – Hrushikesh Betai Jul 16 '12 at 13:10
-
nad what kind of swiping do you need? there is just "swipe" and go – John Smith Jul 16 '12 at 13:34
-
swiping just like changing page. and open the emailcomposer or messagecomposer like you can find in iPad by swiping. with your 4 fingers on screen while app is opened more than 2 – Hrushikesh Betai Jul 16 '12 at 13:45