Around Ios8,xcode6

Source: Internet
Author: User

Nsbundle.mainbundle (). infodictionary

Push code with buttons in IOS 8
1 if(Uidevice.currentdevice (). Systemversion.hasprefix ("7") ){2             3Application.registerforremotenotificationtypes (Uiremotenotificationtype.badge | Uiremotenotificationtype.alert |uiremotenotificationtype.sound)4}Else {5             6var usernotificationaction =uimutableusernotificationaction ()7Usernotificationaction.activationmode = . Foreground8Usernotificationaction.identifier ="Identifier1"9Usernotificationaction.title ="Open Program"Ten  Onevar usernotiaction =uimutableusernotificationaction () AUsernotiaction.activationmode = . Background -Usernotiaction.identifier ="Identifier2" -Usernotiaction.title ="Send Message" theusernotiaction.authenticationrequired =false -Usernotiaction.destructive =true -              -              +var category =uimutableusernotificationcategory () -Category.identifier ="idcategory" + category.setactions ([usernotificationaction,usernotiaction], Forcontext:. Default) A              atvar usernotiset = uiusernotificationsettings (ForTypes:UIUserNotificationType.Sound | Uiusernotificationtype.alert | Uiusernotificationtype.badge, Categories:nsset (Object: category)) - application.registerusernotificationsettings (Usernotiset) -              - application.registerforremotenotifications () -}
Swift Code

Category. the JSON that the identifier server pushes is

{"APS":{"category":"idcategory","Alert":"Alert","badge":"1"," Sound":"default"}}

it will then show which uimutableusernotificationcategoryaccording to the category of the push, when clicking uimutableusernotificationaction called when

1Func application (application:uiapplication, Handleactionwithidentifier identifier:string?, forRemoteNotification UserInfo: [Nsobject:anyobject], Completionhandler: ()Void) {2         3 println (identifier,userinfo)4         5         ifidentifier = ="Identifier2" {6             7var dat = NSData (Contentsofurl:nsurl (string:"http://121.199.28.164/llc/api/?req=userList"))8var str =NSString (Data:dat, encoding:nsutf8stringencoding)9 println (str)Ten         } One          A Completionhandler () -}
Swift Code

Beautifully crafted UI components in IOS 8 using swift and Xcode 6

Http://www.cocoachina.com/industry/20140619/8883.html

1. Send the request by POST:
Http://itunes.apple.com/search?term= your application name &entity=software

2, more simple request, according to AppID, query return results

Http://itunes.apple.com/lookup?id=[appid]

{
Resultcount = 1;
Results = (
{
ArtistID = Developer ID;
artistname = developer Name;
Price = 0;
isgamecenterenabled = 0;
kind = software;
LANGUAGECODESISO2A = (
En
);
Trackcensoredname = review name;
Trackcontentrating = rating;
TrackID = Application ID;
TrackName = Application Name ";
Trackviewurl = Application Introduction URL;
Userratingcount = user Rating;
Userratingcountforcurrentversion = 1;
Version = revision number;
Wrappertype = software;
}
);
}

Ios8,xcode6 around

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.