发布于 2017-03-28 04:02:08 | 136 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的Swift教程,程序狗速度看过来!

Swift编程语言

SWIFT,苹果于2014年WWDC(苹果开发者大会)发布的新开发语言,可与Objective-C*共同运行于Mac OS和iOS平台,用于搭建基于苹果平台的应用程序。


Swift 3.1 已经正式发布了,Swift 3.1 是一个小更新版本,包含对标准库的改进。由于 IBM 和社区其他成员的努力,该版本还包括许多关于 Swift 的 Linux 实现的更新。还有一些 Swift 包管理器的更新。

此外,Swift 3.1 编译器现在可以自动预编译 Objective-C 桥街头,还可以加快混合源代码项目的调试配置构建。

语言更新:

Swift 3.1 与 3.0 兼容,它包含以下的更改和更新,其中大部分都经历了 Swift Evolution process

新的 Sequence 协议成员

Sequence 协议现在有两个新成员:

protocol Sequence {    // ...    /// Returns a subsequence by skipping elements while `predicate` returns    /// `true` and returning the remainder.    func drop(while predicate: (Self.Iterator.Element) throws -> Bool) rethrows -> Self.SubSequence    /// Returns a subsequence containing the initial elements until `predicate`    /// returns `false` and skipping the remainder.    func prefix(while predicate: (Self.Iterator.Element) throws -> Bool) rethrows -> Self.SubSequence  }

点此查看更多:SE-0045: Add prefix(while:) and drop(while:) to stdlib

Swift 版本的可用性

Swift 3.1 扩展了 @availability 属性以使用 Swift 版本来指示声明的生命周期。例如,在 Swift 3.1 中删除的 API 将被写为:

@available(swift, obsoleted: 3.1)  class Foo {    //...  }

点此查看更多:SE-0141: Availability by Swift version

Linux 实现的改进:

  • Implementation of NSDecimal

  • Implementation of NSLengthFormatter

  • Implementation of Progress

  • Many improvements to URLSession functionality, including API coverage and optimized usage of libdispatch

  • Improved API coverage in NSArrayNSAttributedString and many others

  • Significant performance improvements in DataSee more details here

  • Improved JSON serialization performance

  • Memory leaks fixed in NSUUIDNSURLComponents and others

  • Improved test coverage, especially in URLSession

包管理器更新

可编辑的包

默认情况下,软件包的依赖性存储在工具管理的构建目录中,并且新的 swift package edit 命令允许用户在软件包上 “开始编辑”,将其移动到用户的控制下(进入软件包目录),免除依赖更新,允许用户提交并推送对该包的更改。

点此查看更多:SE-0082: Package Manager Editable Packages

更新内容较多,详情请参阅发布主页



历史版本 :
Swift 4.1 发布计划:保持与 Swift 4.0 的源码兼容
Swift 4.0 正式发布,更快更兼容更好用
Swift-MMP 1.0 发布,Swift 编写的 iOS 流媒体音乐播放器
Swift 3.1 发布,包含对标准库的改进
Swift 3.0 发布,开源后首个主要发行版本
苹果将发布 Swift 3.0 公布第四版开发内容
苹果将发布Swift 3.0 公布第四版开发内容
苹果正式发布 Swift 3.0 Preview 1 版本,同时发布 Xcode 8 Beta 版
苹果发布 Swift 3.0 的首个预览版
Swift 3.0首个开发者预览版将在5月12日释出
Swift 3.0 开发者预览版很快发布
Swift 3.0 将会带来什么
最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务