WWDC 2012 contains a session video called: "Adopting Storyboards in Your App" that demonstrates how to embed view Containers by utilizing the "Container View" offered within interface builder for storyboards.
Playing with this functionality I'm running into unpredictable behavior that cause some of the views to be unresponsive. Here is a general summary of what I'm doing:
1. Drag a "View Controller" object into my storyboard and embed into a navigation Controller and assign my user-defined class.
2. Drag 2 "Container View" objects and embed each one within the "View Controller" created in step 1.
3. I insert a simple button on the left within the navigation toolbar when toggled, moves the right embedded view to the right using the logic:
UIView* rightView = [[self.childViewControllers lastObject] view];
UIView* leftView = [self.childViewControllers[0] view];
CGRect newPos = rightView.frame;
newPos.origin.x += leftView.frame.size.width;
main.frame = newPos;
4. Sometimes, this causes my left view (UITableViewController) to not respond to touch events (within Simulator). If I add code to move the view
back to it's starting point, the left view responds again.
Other observations: The placement of my views seems to affect the unresponsiveness. For example, I overlaps 90% of the left view with the right one and
when moved, it was fine. If I overlap 80% for example, the left view doesn't respond - the right one always seems to respond. In general, I have noticed that sometimes the views that are stationary, don't respond - depending on the placement of the view that I'm moving. In all my tests, the view that I move always responds.
thanks,
Nick
0 comments:
Post a Comment