13 報

Share this post

開發者週報 #26 Xcode 11.4 報你知

www.ethanhuang13.com

開發者週報 #26 Xcode 11.4 報你知

Apple/iOS 開發者的一週大小事 2020/02/03-2020/02/09

13
Feb 9, 2020
1
Share this post

開發者週報 #26 Xcode 11.4 報你知

www.ethanhuang13.com

13的話

本週的大事就是 Xcode 11.4 beta 跟 Swift 5.2 丟出了一堆新功能。iOS 13.4 也加了不少使用者功能,但 API 沒有太大變化。

我列出了許多亮點,歡迎提供補充資料。


Universal Purchase

App Store 上 iOS 與 tvOS 可以共用一個 SKU、Bundle ID、使用者評分、購買記錄、IAP 產品等。現在這樣的「好處」即將加入 Mac app。自從 Catalyst 推出以來,這算是預料之中的事。

各平台 apps 的 Bundle ID 要相同,所以對於已經有 Mac app 在架上的開發者來說,要怎麼轉過去還不太清楚。

有趣的一點是 iOS 與 Mac App Store 的分類也會整合。比如 Developer Tools、Graphics & Design 這些分類會加到 iOS。

Xcode 11.4 beta 1

建議自己先翻一下 Release Notes,我列一些重點:

  • 支援 Mac 的 Universal Purchase

  • Crashes 也會包含 universal purchase macOS apps 的 logs

  • SwiftUI Previews 可以直接剪下、複製、貼上 views

  • Simulator 現在支援 push notification 測試。你可以直接拖曳符合 APNs payload 的 JSON 檔

  • Simulator 可以拖曳 CER 或 PEM 檔進去安裝 SSL 憑證

  • simctl 指令支援 keychain 指令、修改使用者權限、切換主題、發測試的 push notification payload

    Twitter avatar for @johnnie_tseng
    Johnny @johnnie_tseng
    Tip: Use `xcrun simctl push <device_id> <bundle_id> <apns_file>` to send simulated notification on iOS simulator using Xcode 11.4! Example: `xcrun simctl push A0AF405F-FE73-45DA-8D7D-F1FE37821992 test.bundle_id apns.apns`
    Image
    1:46 PM ∙ Feb 6, 2020
  • Simulator 的視窗增加了標題列,終於知道要按哪裡拖曳了🤣

  • A rename refactor of a Swift or Objective-C object correctly renames the file containing the object. (32408445) 終於修掉了啊…

  • 支援 SourceKit-LSP

  • Swift 跟 SwiftUI 的錯誤訊息會更準確。可參考 New Diagnostic Architecture Overview

  • XCTests 多了 Test Timeouts 功能

  • XCTests 可以 throw error,包括 setUp、tearDown 也有 throw 的版本

  • 可以在 XCUITests 重設使用者允許權限,方法是 resetAuthorizationStatus(for:)。我第一次知道這些資源可以叫做 protected resource

  • “Enable Testing Search Paths” build setting

  • 可以用 XCTSkipIf / XCTSkipUnless 動態地跳過一些測項

  • 修了很多 bugs

還有很多。

Twitter avatar for @steipete
Peter Steinberger @steipete
Wow there’s a lot of great stuff in the new Xcode! "Previously, when running UI tests, the target under test was (re)installed before each test started. Starting in Xcode 11.4, the target under test is installed once per test session/device, speeding up UI tests considerably."
6:46 PM ∙ Feb 5, 2020
231Likes32Retweets
Twitter avatar for @hrrsn
Harrison Weinerman @hrrsn
New in Xcode 11.4’s view debugger, you can separate CALayers from their hosting view! Previously, sublayers were always flattened onto their hosting view layer. Now, Editor>Show Layers renders sublayers as their own planes. Excited to see something I worked on at Apple ship!
Image
9:24 PM ∙ Feb 5, 2020
683Likes139Retweets
Twitter avatar for @stroughtonsmith
Steve Troughton-Smith @stroughtonsmith
Hello hardware modifier key remapping — this seems new in iPadOS 13.4?
Image
9:37 PM ∙ Feb 5, 2020
390Likes85Retweets
Twitter avatar for @stemichels
Stephan Michels 🇪🇺 @stemichels
Build times in Xcode 11.3.1 vs. 11.4 beta: Objective-C Project 76.5s vs. 59.4s Swift Project 77.5s vs 53.6s Impressive 😍
9:04 AM ∙ Feb 6, 2020
546Likes134Retweets
Twitter avatar for @yonaskolb
Yonas Kolb @yonaskolb
Something I haven't seen mentioned about Xcode 11.4 is that you can now generate memberwise initializers for structs! 🎉 This is useful when initializing the struct from another module where the compiler synthesized initializer doesn't workv
Image
1:32 AM ∙ Feb 7, 2020
358Likes101Retweets
Twitter avatar for @twostraws
Paul Hudson @twostraws
Interesting addition in iOS 13.4 / macOS 10.15.4: the LocalAuthentication framework has a new LACredentialTypeSmartCardPIN option – I wonder if this is the first arrival from Ricky's new team? developer.apple.com/documentation/…
Image
Twitter avatar for @rmondello
Ricky Mondello @rmondello
~ Some Personal News ~ After 7 years as a software engineer on the Safari team, I’m trying something new! I’m now managing a new team at Apple whose goal is to solve the problems people have with accounts, authentication, and passwords. I’m really, really excited!
7:49 PM ∙ Feb 7, 2020
36Likes2Retweets
Twitter avatar for @twostraws
Paul Hudson @twostraws
🎉 iOS 13.4 introduces API that lets us respond to keyboard input in any UIView or UIViewController, making this typing tutor easy to create! I wrote an article with lots more details, including modifier keys, reading multiple presses, and more: hackingwithswift.com/example-code/u…h
Image
10:52 PM ∙ Feb 7, 2020
477Likes87Retweets

Xcode 11.4 beta 1 需要 macOS 10.15.2 不然打不開,不過改 Xcode-beta.app/Contents/Info.plist Minimum system version 那招目前還有用。可以先試試。

Twitter avatar for @nuthatch
stephen ryner jr @nuthatch
You can still edit Xcode 11.4 beta's minimum system version in the Info.plist to launch without installing Catalina
Image
5:53 PM ∙ Feb 6, 2020
179Likes44Retweets

What’s New in Swift 5.2

官方沒出 blog,所以我是讀 Paul Hudson 的介紹,就不多解釋了。

其他:

Twitter avatar for @AirspeedSwift
Ben Cohen @AirspeedSwift
Some nice code size improvements in 5.2. This is a graph the % change in each project in the Swift source compatibility suite.
Image
12:28 AM ∙ Feb 6, 2020
124Likes22Retweets
Twitter avatar for @Catfish_Man
David Smith @Catfish_Man
Subtle Swift 5.2 change: -mutableCopy on bridged Swift Arrays will now do copy on write and produce a Swift NSMutableArray subclass, rather than eagerly copying to an ObjC NSMutableArray. (At least I’m pretty sure I got that change into 5.2)
8:22 PM ∙ Feb 5, 2020
63Likes8Retweets

watchOS 即將支援 IAP

watchOS 6.2 將會包含 StoreKit。具體的 UX 還不清楚。

Introducing Swift Crypto

Apple 在去年推出了 CryptoKit。現在新出 Swift Crypto 則是一套跨平台的 crypto framework。在 Apple 平台使用 CryptoKit,在其他平台則是用 BoringSSL 實作。這兩套實作會共用一套測試,確保兩邊的執行結果一樣。

Swift Crypto 的目標不是盡可能支援各種方法,比較舊或已知不安全的不見得會放進來。另一方面,Apple 硬體特有的 API 也沒有放進來。

Creating a macOS App - SwiftUI Tutorial

SwiftUI 的 Landmark tutorial 本來只有 iOS 版,現在出了 macOS 版。基本上功能相同。我希望有更多。

Apple Arcade 廣告塞進官網

點開看動畫。

Twitter avatar for @EmperiorEric
Ryan Poolos @EmperiorEric
It has been a long time since Apple had whimsy like this. On the homepage no less. Whoever is driving Apple Arcade inside is doing great.
Image
7:08 PM ∙ Feb 4, 2020
876Likes383Retweets

說到 Arcade,tvOS Arcade app 的圖會用特別的方式移動,也是點開看動畫:

Twitter avatar for @jaredsinclair
Jared Sinclair @jaredsinclair
Never noticed that the Arcade app icon cheats some custom shape layer animations. This isn’t the normal stack of static image layers.
Image
3:44 AM ∙ Feb 5, 2020
36Likes4Retweets

有看出來嗎?一般是多層、以不同速率平移(parallax panning),但是這個看起來是搖桿會轉。

SPM 經驗 - zonble

zonble 拿 SPM 包 Swift 跟 Objective-C 的一些經驗:

Twitter avatar for @zonble
zonble 🍺 ゾンビル @zonble
I was making a new internal libray using SPM and wrote example for the library using Swift UI.
4:46 PM ∙ Feb 4, 2020
4Likes1Retweet
Twitter avatar for @zonble
zonble 🍺 ゾンビル @zonble
The folder structure of a Swift package containing C/ObjC/C++ code looks a little bit ugly. Since you have to place all of the public headers in the one specified in Package.swift, you have to put the public and private header files separately.
4:46 PM ∙ Feb 4, 2020
3Likes1Retweet
Twitter avatar for @zonble
zonble 🍺 ゾンビル @zonble
While working on a package containing C/ObjC/C++ code, you should always open the package directly by Xcode 11 but not to create a project file using `swift package generate-xcodeproj`, otherwise you cannot see and import the header files.
4:49 PM ∙ Feb 4, 2020
1Like1Retweet

在任何版本與裝置阻擋 iOS OTA 更新的方法 - 皮樂

我以前都是用安裝 tvOS Beta Profile 的方式,原來還有這麼多招。

台北各大 iOS 社群暫停聚會

Swift Taipei

Twitter avatar for @zonble
zonble 🍺 ゾンビル @zonble
Swift Taipei 本月份暫停乙次。
1:25 PM ∙ Feb 3, 2020
13Likes2Retweets

CocoaHeads Taipei

Twitter avatar for @CocoaHeads_TPE
CocoaHeads Taipei @CocoaHeads_TPE
⏸️可可頭二月份聚會暫停一次⏸️
1:57 PM ∙ Feb 3, 2020
10Likes9Retweets

iOS@Taipei

weak self podcast 24: 你也是薪水小倫嗎?上班族如何利用上班時間精進程式功力

喬喬的雞湯賣藥電台再出發。
下班之後無心無力或沒時間加強技能,那可以在上班時間合理合法地學習嗎?
再問,怎樣搞定你的 PM,或說同事之間怎麼做人處事才好相處?


博君一笑

Property Rapper

程式碼在這裡。

Twitter avatar for @jaredsinclair
Jared Sinclair @jaredsinclair
(unmute to hear it)
Image
11:36 AM ∙ Feb 5, 2020
2Likes1Retweet

loop

我不知道這是什麼語言,反正就是很酷😎

Twitter avatar for @Mrofnet
PawgChamp @Mrofnet
in 2020 we format nested loops for what they are
Image
3:11 PM ∙ Feb 2, 2020
3,401Likes992Retweets

以上就是本期的內容。歡迎轉寄或推薦給同事或開發者朋友。有問題或回饋請直接回覆即可。

Share this post

開發者週報 #26 Xcode 11.4 報你知

www.ethanhuang13.com
Comments
TopNewCommunity

No posts

Ready for more?

© 2023 ethanhuang13
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing