2

Switching between different iphone views is a regular thing I need to do. I want to find best practices around doing this. My class contains a method viewswitcher and it takes a parameter "viewName". I am trying to pass controller name and this single method works for my whole app to slide or rotate views to show/display new views. But, I am getting error.

I am new. Please, if you find any silly mistake in my question please correct me.

Thank You.

bryanmac
  • 38,941
  • 11
  • 91
  • 99
supera
  • 580
  • 5
  • 13

3 Answers3

1

Without specifics on your code or error, it's tough.

But, From the UIView Programming Guide:

http://developer.apple.com/library/ios/#documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/CreatingViews/CreatingViews.html

... transitionFromView:toView:duration:options:completion: methods to swap out entire sets of views for new ones.

http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIView_Class/UIView/UIView.html#//apple_ref/occ/clm/UIView/transitionFromView:toView:duration:options:completion:

bryanmac
  • 38,941
  • 11
  • 91
  • 99
  • @bryanmac Please view this question http://stackoverflow.com/questions/16337706/need-assistance-regarding-transitionfromviewtoviewdurationoptionscompletion/16338755?noredirect=1#16338755 – S.J May 03 '13 at 05:26
0

Without any code or more specifics in your question, it's very hard to help you. Please post more details of what you are trying, what error you are seeing etc.

In general, here are some things you might find useful:

  • You can use a UINavigationController to implement navigation between different views. Do a search for UINavigationController tutorials.
  • If you want to display modal view controllers, look at the documentation for the pushModalViewController:animated method on UIViewController.
triangle_man
  • 1,072
  • 6
  • 10
0

If understand your question correctly, you need to look at the following two class methods in the UIView documentation:

  • transitionWithView:duration:options:animations:completion:
  • transitionFromView:toView:duration:options:completion:

Samples are readily available online. Just google "UIView transitionWithView" and "UIView transitionFromView"

nzeltzer
  • 521
  • 4
  • 9