I'll actually go backwards on this one...
"Another question I have (Not really important just curious) is that in newFrame I'm setting the y to the same thing as it is when I initially set the bounds, but yet it moves. I would have expected newFrame to require a y value of "0" but when I did that nothing happened. Just wondering why that is."
This is actually a very important question for you to have answered, because it has a lot to do with why your code isn't working. You're misunderstanding some very important concepts.
First off, the bounds
of a UIView
determine its position entirely in relation to itself. The frame
determines the UIView
's position within its superview. In your code, you're originally setting the view's bounds
, not the frame
--
[[viewController view] setBounds:CGRectMake(0, ([UIScreen mainScreen].bounds.size.height * -1), viewController.view.bounds.size.width, viewController.view.bounds.size.height)];
-- so you're not at all originally determining the view's place within its superview, only in relation to itself.
Essentially, you're ending up with a CCouponDetailViewController
view with a 0x0 frame, but since you haven't specified that you want your UIView
to clip its subviews, the portions of your CCouponDetailViewController
view are not actually on top of their view, but visible and hanging over the UIView
's bounds. The reason they aren't selectable is because they're not actually within the UIView
.
So to fix this, set your UIView
's initial frame instead of setting a bounds (I've editing the initial frame to start at the bottom of the screen like you're trying to do. I don't understand the height x -1 thing you're trying to do, by the way...) :
[[viewController view] setFrame:CGRectMake(0, [UIScreen mainScreen].bounds.size.height, viewController.view.bounds.size.width, viewController.view.bounds.size.height)];
Secondly, you're setting your new frame incorrectly. You can't set the CGRect this way:
CGRect newFrame = viewController.view.frame;
newFrame.origin.x = 0;
newFrame.origin.y = ([UIScreen mainScreen].bounds.size.height * -1);
Instead, set it using CGRectMake
(And, again, I edited the y value so that the view ends up at the top of the screen like you're trying to do):
CGRect newFrame = CGRectMake(0, 0, viewController.view.frame.width, viewController.view.frame.height);