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

printf

macrumors regular
Original poster
Aug 27, 2008
105
0
i have a uiview and a uiwebview. at the moment they have no relationship with one another because i'm stuck at figuring out the 'correct' way to set them up. it really makes no difference to me, but i'd like to know which way is best.

on one hand, i could make the uiwebview a subview of my uiview. that would work for my purposes. however, it just seems weird that i'd be setting this up within my custom uiview class - i mean, isn't this the job of a viewcontroller?

on the other hand, i could treat both views as equals and let the view controller switch them out perhaps? but my custom uiview responds to events (such as touchesEnded) and only it knows when it's time is up and it's to be replaced by the uiwebview. the viewcontroller has no knowledge of this and therefore cannot know when to switch between the two.

any insight on the best approach here? thanks!
 

printf

macrumors regular
Original poster
Aug 27, 2008
105
0
ah, i overlooked the navigation controller because i didn't know the nav bar could be removed.

still curious though, is there a way for one view to inform the nav controller that it's ready to be switched out with the other view? like from a touchesEnded event that's captured in that view?

btw, i'm not using IB.
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
I'm not clear by what you mean by "switched out". Any view in a navigation controller can either push another view controller into the navigation stack or pop itself off the navigation stack.
 

printf

macrumors regular
Original poster
Aug 27, 2008
105
0
right, and that's the part i'm confused with. every ui nav controller example i've seen on the web uses buttons hooked into ibactions in the app delegate to push/pop views.

my requirement is a little different. i have a 'splash screen' view that displays fade-in animation and should pop the splash view and push the main application view onto the nav stack when the animation is complete OR a user 'touches' the view anywhere. i'm still an mvc novice, so i'm not sure how to get the splash screen view to tell the navigation controller to push the main view. does that make sense?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.