Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198
SpringBoard (Class): Difference between revisions - iPhone Development Wiki

SpringBoard (Class): Difference between revisions

From iPhone Development Wiki
(Added top app.)
(Cleaned up)
Line 4: Line 4:


== Monitoring Orientation of Top App ==
== Monitoring Orientation of Top App ==
Whenever the orientation of the top application may be changed, <tt>-[SpringBoard noteUIOrientationChanged:display:]</tt> will be called. Therefore, you can hook this method to be notified of this info. The orientation (as angle in degrees) can be received with <tt>-[SpringBoard UIOrientation]</tt>.
Whenever the orientation of the top application is changed, <tt>-[SpringBoard noteUIOrientationChanged:display:]</tt> is called. Therefore, you can hook this method to be notified of the event.


== Sending messages to SpringBoard ==
== Sending messages to SpringBoard ==
Because SpringBoard inherits UIApplication you can send messages like this: <tt>[[SpringBoard sharedApplication] aMethod]</tt>
Because SpringBoard inherits from UIApplication, you can send messages to it as follows: <tt>[[SpringBoard sharedApplication] aMethod]</tt>


== Getting the top SBApplication ==
== Getting the top SBApplication ==
You can get a reference to the top SBApplication like so: <tt>[[SpringBoard sharedApplication] _accessibilityFrontMostApplication]</tt>.
A reference to the top SBApplication may be obtained by using the following method: <tt>[[SpringBoard sharedApplication] _accessibilityFrontMostApplication]</tt>.


== References ==
== References ==

Revision as of 23:04, 8 October 2013

SpringBoard is the singleton class that manages the SpringBoard application.

Monitoring Orientation of Top App

Whenever the orientation of the top application is changed, -[SpringBoard noteUIOrientationChanged:display:] is called. Therefore, you can hook this method to be notified of the event.

Sending messages to SpringBoard

Because SpringBoard inherits from UIApplication, you can send messages to it as follows: [[SpringBoard sharedApplication] aMethod]

Getting the top SBApplication

A reference to the top SBApplication may be obtained by using the following method: [[SpringBoard sharedApplication] _accessibilityFrontMostApplication].

References