Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

polezero

macrumors newbie
Original poster
Feb 6, 2011
2
0
Hello,


I am trying to implement an infinite horizontal scroller using only 3 reused views. Each view is managed by its own UIViewController object. At some point, I try to exchange the views using a simple assignment as

Code:
leftViewController.view = centerViewController.view;
centerViewController.view = rightViewController.view;

However, I can not see the view contents after the function that does the assignments return.

Can I exchange the views like above or is there a more proper way of achieving this?

Many thanks.

I have noticed that after the assignment

Code:
viewControllerA.view = viewControllerB.view;

viewControllerA.view.frame.origin is reset to (0,0). That's somewhat odd.

Instead of trying to exchange the views, I exchange the controllers themselves. It seems to work...
 
Last edited by a moderator:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.