Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Swift 雙週報 2016/2/2

Johnlin
February 02, 2016

Swift 雙週報 2016/2/2

Johnlin

February 02, 2016
Tweet

More Decks by Johnlin

Other Decks in Programming

Transcript

  1. From the core • Swift 2.2 branch 已經建立 [1] •

    Swift 已經可以在 FreeBSD 上運作 [2] • Swift 開始被Port 至 cygwin(Windows) [3] • Swift project 開始使用CI [8]
  2. Package Manager Testing 未來Swift package manager 將會整合測試功能。只要將Test 放進 Tests資料夾中, 再執行

    swift test 就會自動編譯並執行測試。 swift build 時也會同時執行測試以確保品質
  3. Function Argument Label 在將function 指定至變數時可以指定Label extension UIView { func insertSubview(view:

    UIView, at index: Int) func insertSubview(view: UIView, aboveSubview siblingSubview: UIView) func insertSubview(view: UIView, belowSubview siblingSubview: UIView) } let fn: (UIView, UIView) = { view, otherView in button.insertSubview(view, aboveSubview: otherView) } 未來 let fn = someView.insertSubview(_:at:) let fn1 = someView.insertSubview(_:aboveSubview:)
  4. Cocoa Swift API 的改變 Swift 3.0 的 Cocoa API 將會有重大的改變,變得更加直覺與swifty

    class UIBezierPath : NSObject, NSCopying, NSCoding { ... } ... path.addLineToPoint(CGPoint(x: 100, y: 0)) path.fillWithBlendMode(kCGBlendModeMultiply, alpha: 0.7) 將變成 class UIBezierPath : Object, Copying, Coding { ... } ... path.addLineTo(CGPoint(x: 100, y: 0)) path.fillWith(kCGBlendModeMultiply, alpha: 0.7)
  5. References [1]: https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20160111/000802.html [2]: https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20160118/000911.html [3]: https://lists.swift.org/pipermail/swift-users/Week-of-Mon-20160111/000862.html [4]: https://github.com/apple/swift-evolution/blob/master/proposals/0019-package-manager-testing.md [5]:

    https://github.com/apple/swift-evolution/blob/master/proposals/0021-generalized-naming.md [6]: https://github.com/AE9RB/SwiftGL.git [7]: https://swiftlang.tw/swift%20blog/swift/cocoa/api/2016/01/29/swift-api-transformation/ [8]: https://swiftlang.tw/continuous-integration/