1 , overview
The UIApplication object is a symbol of the application. Each application has its own UIApplication object, and it is a singleton (only one object, we cannot create a new object, we can only get this object). This singleton object can be obtained by [UIApplication Sharedapplication]. a IOS the first object created after a program is started is uiapplication Object . With UIApplication objects, you can perform some application-level operations.
2 , uiapplication the Common Properties
1. Set the red reminder number in the upper right corner of the application icon
@property (nonatomic) Nsinteger applicationiconbadgenumber;
2, set the visibility of the network indicator
@property (nonatomic,getter=isnetworkactivityindicatorvisible) BOOL networkactivityindicatorvisible;
3 , iOS7 the status bar in
1 , the management of the status bar
Starting with IOS7, the system provides 2 ways to manage the status bar:
The first type:
Through Uiviewcontroller management (each uiviewcontroller can have its own different status bar).
The second type:
Managed by UIApplication (the status bar of an application is managed uniformly by it).
Use Uiviewcontroller to manage the status bar:
In IOS7, by default, the status bar is managed by Uiviewcontroller, and Uiviewcontroller can easily manage the visibility and style of the status bar by implementing the following methods:
(1) style of the status bar
-(Uistatusbarstyle) Preferredstatusbarstyle;
(2) Visibility of the status bar
-(BOOL) Prefersstatusbarhidden;
Using UIApplication to manage the status bar
Use uiapplication to manage the status bar:
If you want to use uiapplication to manage the status bar, you first have to modify the Info.plist settings.
You can then use UIApplication to manage the status bar:
For example: Use a fade-out animation effect to hide the status bar:
[App Setstatusbarhidden:yes Withanimation:uista Tusbaranimationfade];
Set the status bar style to white:
App.statusbarstyle = uistatusbarstylelightcontent;
Hide the status bar:
App.statusbarhidden = YES;
2 , OpenURL
UIApplication has a very powerful OpenURL: method
-(BOOL) OpenURL: (nsurl*) URL;
OpenURL: partial functionality of the method :
(1) Call
UIApplication *app = [UIApplication sharedapplication];
[App Openurl:[nsurl urlwithstring:@ "tel://10086"];
(2) Texting
[App Openurl:[nsurl urlwithstring:@ "sms://10086"];
(3) e-mail
[App Openurl:[nsurl urlwithstring:@ "Mailto://[email protected]"];
(4) Open a webpage resource (auto jump to browser open)
[App Openurl:[nsurl urlwithstring:@ "http://ios.itcast.cn"];
(5) Open other apps
. . . . . . .
iOS Development uiapplication