zoukankan      html  css  js  c++  java
  • ios8,xcode6 周边

    NSBundle.mainBundle().infoDictionary

    iOS 8中带按钮的推送代码

     1 if ( UIDevice.currentDevice().systemVersion.hasPrefix("7") ){
     2             
     3             application.registerForRemoteNotificationTypes(UIRemoteNotificationType.Badge | UIRemoteNotificationType.Alert | UIRemoteNotificationType.Sound)
     4         }else {
     5             
     6             var userNotificationAction = UIMutableUserNotificationAction()
     7             userNotificationAction.activationMode = .Foreground
     8             userNotificationAction.identifier = "identifier1"
     9             userNotificationAction.title = "打开程序"
    10 
    11             var userNotiAction = UIMutableUserNotificationAction()
    12             userNotiAction.activationMode = .Background
    13             userNotiAction.identifier = "identifier2"
    14             userNotiAction.title = "发送消息"
    15             userNotiAction.authenticationRequired = false
    16             userNotiAction.destructive = true
    17             
    18             
    19             var category = UIMutableUserNotificationCategory()
    20             category.identifier = "idCategory"
    21             category.setActions([userNotificationAction,userNotiAction], forContext: .Default)
    22             
    23             var userNotiSet = UIUserNotificationSettings(forTypes: UIUserNotificationType.Sound | UIUserNotificationType.Alert | UIUserNotificationType.Badge , categories: NSSet(object: category))
    24             application.registerUserNotificationSettings(userNotiSet)
    25             
    26             application.registerForRemoteNotifications()
    27         }
    swift Code

    category.identifier 服务器推送的json为

    {"aps":{"category":"idCategory","alert":"alert","badge":"1","sound":"default"}}

    之后会根据 推送的category 显示哪个UIMutableUserNotificationCategory,当点击UIMutableUserNotificationAction时调用

     1 func application(application: UIApplication, handleActionWithIdentifier identifier: String?, forRemoteNotification userInfo: [NSObject : AnyObject], completionHandler: () -> Void) {
     2         
     3         println(identifier,userInfo)
     4         
     5         if identifier == "identifier2" {
     6             
     7             var dat = NSData(contentsOfURL: NSURL(string: "http://121.199.28.164/llc/api/?req=userList"))
     8             var str = NSString(data: dat, encoding: NSUTF8StringEncoding)
     9             println(str)
    10         }
    11         
    12         completionHandler()
    13     }
    swift Code

     

     

    iOS 8中使用Swift和Xcode 6制作精美的UI组件

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

     

    1、用 POST 方式发送请求:
    http://itunes.apple.com/search?term=你的应用程序名称&entity=software

    2、更简单的请求, 根据appid,查询返回结果

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

    {  
        resultCount = 1;  
        results =     (  
                    {  
                artistId = 开发者 ID;  
                artistName = 开发者名称; 
                price = 0; 
                isGameCenterEnabled = 0;  
                kind = software;  
                languageCodesISO2A =             (  
                    EN  
                ); 
                trackCensoredName = 审查名称;  
                trackContentRating = 评级;  
                trackId = 应用程序 ID;  
                trackName = 应用程序名称";  
                trackViewUrl = 应用程序介绍网址;  
                userRatingCount = 用户评级;  
                userRatingCountForCurrentVersion = 1;  
                version = 版本号;  
                wrapperType = software; 
          }  
        );  
    }  

  • 相关阅读:
    Brain network involved in autonomic functions 与自主功能相关的大脑网络
    Brief summary of classical components of ERP 事件相关成分(ERP)经典成分小结
    ICA & Percentage Variance Account For (PVAF)
    数据处理中白化Whitening的作用图解分析
    Loadings vs eigenvectors in PCA 主成分分析(PCA)中的负荷和特征向量
    主成分分析(PCA)和独立成分分析(ICA)相关资料
    Sketch of heart and QRS complex 心脏及QRS波群简图
    Brain Network visulation in EEG 脑电网络可视化
    Phase Locking Value (PLV) 神经信号的锁相值
    ubuntu16.04下的一些基本操作笔记
  • 原文地址:https://www.cnblogs.com/loganv/p/3981334.html
Copyright © 2011-2022 走看看