Dev:SBAppContextHostManager

The SBAppContextHostManager class was introduced in iOS 5 when 's means for handling the SBAppContextHostView class was redesigned. The methods which track an applications SBContexts and keep it updated with any changes were moved from SBAppContextHostView to SBAppContextHostManager. Most of SBAppContextHostManagers other methods control access to the single SBAppContextHostView each application has.

Context View Requesters
When an object whats to manipulate an application, such as the multitasking gestures on the iPad sliding applications to one side, they use the applications SBAppContextHostView rather then manipulating the application itself. However, as expanded how many classes use this single view the chance 2 could be using it at once increased. In iOS 5 apple introduced the SBAppContextHostManager to manage all the different groups that want to access it.

The requester is an NSString which is used to identify the request. Everything which wants to access the context view should use a unique id. This will add the requester to it's iVar "NSMutableArray *_hostRequesters;" which tells it to create an SBHostWrapperView. orderFront indicates whether or not the SBAppContextHostView should be added as a subview or not (and so become the active requester).

This method is the iOS 6 replacement for the above method. Rather then stating that the requester wants to be the activate requester now, it instead passes a priority (probably indicating how import it is it is the active requester). The range of values used for the priority variable are unknown.

This is the method that moves the SBAppContextHostView into the SBHostWrapperView associated with that requester. If the requester was not enabled then it is does nothing.

This returns the SBHostWrapperView for the specified requester.

This disables context hosting for the specified requester. The SBAppContextHostView is removed from the SBHostWrapperView for the requester, if it was active and removes the requester from the list of allowed requesters.

This disables context hosting for all enabled requesters.

Screenshots
These methods return a screenshot of the application, and only the application. As they only take a screenshot of the application, and not the screen, they should be the preferred method of getting app screenshots in iOS. Whereas functions such as UICreateScreenImage include everything on screen, including the multitasking switcher or the notification center, these methods allow a screenshot of a currently running application. They allow you to specify a frame you want the image to be of, to exclude certain windows (such as say the status bar or an alert), and to apply other settings to the image.

Other methods
This method returns not an SBHostWrapperView but the actual underlying SBAppContextHostView itself. The method name is meant to deter you from using it, and indeed you should not use this method. Even if you know what you are doing using the other methods is safer.

This returns the number of contexts the application has (the number of UIWindows effectively).