I have created two UIViewControllers in IB.
PROBLEM 1: I can't make the 2. VC transparent. I have read a lot of stackOverFlow solutions but nothing seems to work in my case. I have tried the following setup in IB both in my current project and in this simple project and something strange occurs (IB,for 2.VC):
- Setting the alpha value below 0,5
- Setting opaque to "checked"
- Setting the background color to "black"
https://imageshack.com/i/kqdXWk9Jp
The second VC gets pushed when I click "GO TO NEXT VC" (push or modally , doesn't matter) and while he is being pushed I see the the result I want:
https://imageshack.com/i/idXUCFCPp
... and when the push is finished the new VC changes from being transparent to black (not transparent):
https://imageshack.com/i/iqmLw8D1p
I have no clue why this is happening and I cant get it to stop working like that. Q1: Why is this happening?
Q2: Why can't I change the properties of the views programmatically when the views are created with IB? I have done this thousand times WITHOUT using IB. As soon as I start using IB things don't work like they are supposed especially when I try to edit stuff programmatically. When I do all of these steps without IB only in code everything works perfectly fine but I need to use the IB in my next project. I am using Xcode 5.1.1. on mac mini (late 2009) with Mavericks.
Sorry for bad English.
Your problem is because the memory management of iOS removes the previous interface ViewController, to save resources.
After iOS7, you can customize the transition viewControllers. Please read: UIViewControllerAnimatedTransitioning Protocol Reference.
I also had the same problem and managed to solve it by following the tutorial Custom UIViewController Transitions.
If you are still having doubts, there is another tutorial to help you: iOS7: Custom Transitions.
Hope you get success!