A summary of the singleton uiapplication of iOS and some common methods

Source: Internet
Author: User

UIApplication is a symbol of an application and is a single-instance object

Method:
OpenURL (phone, texting)

Address of the Nsurl resource unique path
Specification: Protocol header://Host address/resource path
Network resources: Http://www.baidu.com/image/123.png
Local resources: File:///user/desktop/image/321.png


The status bar is given to application management (add the following command to the system Info.plist file)
View controller-based status bar appearance = NO
Note: IOS6 uses application management
IOS 7 8 Using Controller management

Controller Management
Style of the status bar
-(Uistatusbarstyle) Preferredstatusbarstyle;
Visibility of the status bar
-(BOOL) Prefersstatusbarhidden;

UIApplication Management
To set the visibility of the status bar through application
App.statusbarhidden = YES;
[App Setstatusbarhidden:yes Withanimation:uistatusbaranimationslide];

To set the style of the status bar by application
App.statusbarstyle = uistatusbarstylelightcontent;
[App Setstatusbarstyle:uistatusbarstylelightcontent Animated:yes];

 //Open Web pageUIApplication *app =[UIApplication sharedapplication]; Nsurl*url = [Nsurl urlwithstring:@"http://www.baidu.com"];            [App Openurl:url]; //set whether the taskbar is hiddenApp.statusbarhidden =YES; //animate when taskbar is hidden[app Setstatusbarhidden:yes Withanimation:uistatusbaranimationfade]; //set the style of the taskbarApp.statusbarstyle =uistatusbarstylelightcontent; //load Animation When setting the taskbar style[app Setstatusbarstyle:uistatusbarstylelightcontent Animated:yes]; //show Daisy with a netApp.networkactivityindicatorvisible =YES; //Set icon NotificationsUIApplication *app =[UIApplication sharedapplication]; //First judge the version number    if([[[[Uidevice currentdevice]systemversion]floatvalue]>=8.0) {        //Create user Pass settings (this method must be performed after IOS8)Uiusernotificationsettings *noti =[uiusernotificationsettings Settingsfortypes:uiusernotificationtypebadge Categories:nil]; //Registration Permissions[app Registerusernotificationsettings:noti]; }    //Display the number of icon notificationsApp.applicationiconbadgenumber = -;

Summary of single-instance uiapplication for iOS and some common methods

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.