美文网首页
xcode swift 3.0 适配

xcode swift 3.0 适配

作者: chinwy | 来源:发表于2016-11-29 16:55 被阅读116次

    附上以往xcode版本下载地址
    https://developer.apple.com/download/more/

    Alamofire

    encoding,编码方式,Alamofire提供一个枚举来表示请求所用编码
    如.URL,.JSON
    那么GET方式请求数据一般使用.URL编码方式
    POST方式用.JSON编码方式
    
    'setStatusBarHidden(_:with:)' was deprecated in iOS 9.0: Use -[UIViewController prefersStatusBarHidden]
    隐藏状态栏 
            self.setNeedsStatusBarAppearanceUpdate()
               
        override var prefersStatusBarHidden: Bool {
            return false
        }
        
        override var preferredStatusBarUpdateAnimation: UIStatusBarAnimation {
            return UIStatusBarAnimation.fade
        }
    
    
    'setStatusBarOrientation(_:animated:)' was deprecated in iOS 9.0: Explicit setting of the status bar orientation is more limited in iOS 6.0 and later
     旋转屏幕
            UIApplication.shared.statusBarOrientation = .portrait
    
    
     'UIAlertView' was deprecated in iOS 9.0: UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead
    
      //Create the AlertController
      let actionSheetController: UIAlertController = UIAlertController(title: "Alert", message: "Swiftly Now! Choose an option!", preferredStyle: .Alert)
    
      //Create and add the Cancel action
      let cancelAction: UIAlertAction = UIAlertAction(title: "Cancel", style: .Cancel) { action -> Void in
        //Do some stuff
        }
      actionSheetController.addAction(cancelAction)
        //Create and an option action
      let nextAction: UIAlertAction = UIAlertAction(title: "Next", style: .Default) { action -> Void in
        //Do some other stuff
        }
      actionSheetController.addAction(nextAction)
      //Add a text field
      actionSheetController.addTextFieldWithConfigurationHandler { textField -> Void in
           //TextField configuration
         textField.textColor = UIColor.blueColor()
       }
    
       //Present the AlertController
       self.presentViewController(actionSheetController, animated: true, completion: nil)
    
    

    相关文章

      网友评论

          本文标题:xcode swift 3.0 适配

          本文链接:https://www.haomeiwen.com/subject/ydxzpttx.html