30
  1. What is UITransitionView?
  2. What is UILayoutContainerView?
  3. Will I get in trouble for adding subviews to them?

They are the superviews of a UITableView which is inside of a UINavigationController which is inside of a UITabBarController.

UITransitionView I got by asking for the superview of the table view. UILayoutContainerView I got by asking for the superview of UITransitionView.

2 Answers2

28

They are both internal views used by Apple and not published in the SDK.

It's difficult to say exactly what Apple will or won't do however, adding a view to an undocumented view you retrieve from a superView message is not contentious. What you should not do (or be careful if you do do) is make assumptions about the view you are adding to. Specifically its class but even basic things like the fact that it even exists.

What are you trying to do? There may be a simpler way - like adding your view directly to the app's UIWindow.

Rog
  • 16,936
  • 9
  • 49
  • 73
  • 1
    Yes UIWindow was what I was looking for. (I wanted to add a fixed view.) Thanks! –  Apr 24 '09 at 08:24
0

Directly doing anything with those views goes against the SDK guidelines of not using undocumented APIs. So, sadly, it doesn't matter much what they do.

Alex Wayne
  • 162,909
  • 46
  • 287
  • 312
  • do you have a reference to those guidelines (ie of advising against using undocumented APIs)? – abbood Apr 26 '13 at 11:29
  • 6
    The [iOS developer agreement](http://seattleclouds.com/ticketfiles/8665/ios_program_standard_agreement_20120912.pdf) explicitly forbids it. Page 9 states: `3.3.1 Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs.` and any class or not listed in their documentation is considered _not_ documented, therefore private, and grounds for app store rejection. They've been enforcing this for a long time. – Alex Wayne Apr 26 '13 at 17:06
  • ah I see.. i guess that's the difference between someone who has submitted an app to a store before and someone who hasn't :p – abbood Apr 26 '13 at 17:10
  • 6
    `self.navigationController.view.addSubView(UIView())` is NOT undocumented and will NOT get you rejected from the app store. If they didn't want you doing that they wouldn't have subclassed from `UIViewController` – Ryan Romanchuk Mar 06 '15 at 07:56
  • 2
    Even if you don't plan to "use" these private views directly, your app **is** still using them implicitly. So you may indeed find cases where you run into these views and need to understand when and why they exist (for example, during debugging the view hierarchy). Anyways, take a look at the class-dump runtime headers for these files to get a clue about what special features they have: [`UILayoutContainerView.h`](http://bit.ly/1BxgWQX) and [`UITransitionView.h`](http://bit.ly/1E6727l). – smileyborg Mar 11 '15 at 18:06