13 報

Share this post

開發者週報 #93 WFH 時怎麼樣才不會 WTF

www.ethanhuang13.com

開發者週報 #93 WFH 時怎麼樣才不會 WTF

Apple/iOS 開發者的一週大小事 2021/05/24-2021/05/30

13
May 30, 2021
1
Share this post

開發者週報 #93 WFH 時怎麼樣才不會 WTF

www.ethanhuang13.com

13的話

提醒一下 WWDC 就快到了。就算你沒有空參加,也要留點時間把第一天 Keynote、State of the Union 兩場看完。

很多人不知道這兩場的差別,前者其實是對媒體與大眾,介紹一些新功能、新名詞。後者才重點針對開發者,把新技術、新的 API 列出來,這樣你就知道接下來要追哪些 sessions。

(看前一期 · 回首頁)


🍴WWDC21 網站圖片玄機

是 Eat, Sleep, Code 的意思嗎?

Twitter avatar for @wongmjane
Jane Manchun Wong @wongmjane
WWDC 2021 products: 🍴 Apple Fork and Knife 😴 Apple Sleep 💻 MacBook developer.apple.com/wwdc21/
Image
4:12 PM ∙ May 24, 2021
1,352Likes171Retweets

💡WWDC21 Digital Lounges

今年多了直接跟 Apple 工程師的線上聊天室。6/1 開始免費註冊,人數有上限請把握機會。

🆕What’s New in Swift 5.5

覺得最近太閒、想預習 WWDC 的話可以先讀。先說,這網頁印成 A4 至少也要 25 頁。我把標題跟作者的相關推文列一下:

  • Async/await

Twitter avatar for @twostraws
Paul Hudson @twostraws
Async/await functions allow us to run complex asynchronous code almost is if it were synchronous. It doesn't make them concurrent – that's a separate change! – but it does make for beautifully clean API.
A Swift 5.5 function marked with the async keyword. Inside it awaits three other asynchronous functions, then prints a final result.
4:44 PM ∙ May 28, 2021
136Likes12Retweets
  • Async/await: sequences

  • Effectful read-only properties

Twitter avatar for @twostraws
Paul Hudson @twostraws
Last but not least, read-only properties can now be marked using async and/or throws, making them much more at home in Swift 5.5's asynchronous world.
A Swift struct that loads a filename from the app bundle and returns its contents. The contents are available through a property that is marked both async and throws, because it might take time to execute and might fail.
4:53 PM ∙ May 28, 2021
70Likes6Retweets
  • Structured concurrency

Twitter avatar for @twostraws
Paul Hudson @twostraws
Structured concurrency lets us create tasks and task groups to execute work concurrently, wait for it to complete, or cancel it as needed.
Code that calculates the first 50 numbers of the Fibonacci sequence using Task so that it executes concurrently.
4:46 PM ∙ May 28, 2021
57Likes3Retweets
  • async let bindings

Twitter avatar for @twostraws
Paul Hudson @twostraws
Async let bindings allow us to create concurrent tasks easily, then wait for all them to complete later on. The tasks start running immediately, making this really lightweight syntax.
A Swift 5.5 function that uses async let to start three child tasks, then uses await to wait for all three to finish before using them together.
4:45 PM ∙ May 28, 2021
93Likes11Retweets
  • Continuations for interfacing async tasks with synchronous code

  • Actors

Twitter avatar for @twostraws
Paul Hudson @twostraws
Actors are like classes that are designed to be safe to use in concurrent environments, because Swift automatically ensures their mutable state is only ever accessed by a single thread at any given time. 👋 Race conditions!
A Swift 5.5 actor that has a deck of cards and can safely trade them with another user.
4:48 PM ∙ May 28, 2021
88Likes8Retweets
  • Global actors

Twitter avatar for @twostraws
Paul Hudson @twostraws
@ MainActor lets us ensure that a function or property is used only on the main thread. Swift will automatically queue up any work to happen there, as if we had used DispatchQueue.main ourselves.
A data controller class that uses @MainActor on its save() method, to ensure saving data is done safely.
4:49 PM ∙ May 28, 2021
102Likes6Retweets
  • Sendable and @Sendable closures

  • #if for postfix member expressions

Twitter avatar for @twostraws
Paul Hudson @twostraws
"#if for postfix member expressions" sounds obscure, but if you know you know – and you'll be really glad this one has landed.
A SwiftUI text view followed by a #if condition that attaches one of two font sizes depending on the operating system.
4:50 PM ∙ May 28, 2021
144Likes16Retweets
  • Allow interchangeable use of CGFloat and Double types

Twitter avatar for @twostraws
Paul Hudson @twostraws
The Swift compiler can now implicitly insert initializers to convert between CGFloat and Double, which is going to make many APIs (not least SwiftUI) so much nicer!
A Swift snippet that shows a CGFloat being added to a Double with no problems.
4:51 PM ∙ May 28, 2021
200Likes26Retweets
  • Codable synthesis for enums with associated values

Twitter avatar for @twostraws
Paul Hudson @twostraws
Swift 5.5 sees another welcome upgrade for Codable: it now supports enums with associated values!
A Swift enum with various associated values attached to its cases; the whole thing conforms to Codable.
4:52 PM ∙ May 28, 2021
301Likes38Retweets
  • lazy now works in local contexts

  • Extend property wrappers to function and closure parameters

  • Extending static member lookup in generic contexts

  • And there’s still more…

☠️M1RACLES 漏洞

Apple Silicon M1 硬體層面的漏洞。實際上沒有那麼嚴重,不過這個網站的 FAQ 寫得很有趣,不怕英文的可以讀一下。

🫓iMac 有多薄

比 iPhone 一代還薄。

Twitter avatar for @whoiskatrin
Kate @whoiskatrin
something to think about
Image
3:47 PM ∙ May 28, 2021
12,868Likes3,285Retweets

順便跟大家說一下,iMac(不算腳架)的體積只比 Mac mini 多 17.5%。

Twitter avatar for @ethanhuang13
13 @ethanhuang13
🖥睡前突然想來算 iMac M1 的體積。官方沒給不含支架的高,故用寬推算。總共是: 54.7 × 26.1 × 1.15 ≈ 1642 cm³ 相較之下,Mac mini: 19.7 × 19.7 × 3.6 ≈ 1397 cm³ iMac 竟然只比 Mac mini 多 17.5% 而已 當然 M1 小體積王者是 iPad Pro 11 吋 24.76 × 17.85 × 0.59 ≈ 261 cm³ #買都買 #來睡
5:43 PM ∙ May 25, 2021

🤪Random Tweets

論用 Twitter 學技術:

Twitter avatar for @ftium4
龙爪槐守望者 @ftium4
我来推特想学技术,所以关注了很多独立开发者。结果熊猫吃短信的开发者在迷恋小护士;落格输入法的作者在转黄图;pastenow开发者在探咖啡店,技术屁也没学到,黄图倒是攒了一堆😂
3:04 AM ∙ May 24, 2021
2,271Likes371Retweets

好孩子不要學:

Twitter avatar for @keleftheriou
Kosta Eleftheriou @keleftheriou
The review: “This app forced me to give it a good rating before I could use it.” You: “Pfff, no one’s FORCING you!” The app: 🤯
Image
8:29 PM ∙ May 25, 2021
6,806Likes2,365Retweets

只要有螢幕的地方就能...

Twitter avatar for @bttfdrs
Dr.s @bttfdrs
Twitterとかインスタで見たやつ試しにやってみたらできた! カッコいい!これで未来に帰れる!⚡️🕰
Image
3:29 AM ∙ May 26, 2021
32,689Likes9,081Retweets
Twitter avatar for @LionKing2303
Arie Peretz @LionKing2303
My imagination going wild right before #WWDC21 is like: Xcode for WatchOS
Image
4:33 AM ∙ May 26, 2021
544Likes42Retweets

不知道從哪看到的我就想轉一下

Twitter avatar for @jamella_hoshino
阿米娜・阔伊姆@頑張らない? @jamella_hoshino
Image
10:53 AM ∙ May 26, 2021
438Likes128Retweets

This is fine.

Twitter avatar for @joe_trash_talk
__難哥 @joe_trash_talk
《火神的眼淚 - 軟體工廠篇》 不知道有沒有搞頭?🤔
This Is Fine GIF
4:22 AM ∙ May 28, 2021

🎙weak self podcast 76: 在家工作!WFH 時怎麼樣才不會 WTF

資深聽眾你沒有看錯,節目標題 reuse 了。這次是由有五年 WFH 經驗的波肥來分享絕招。

校正上架 了🤪

💼職缺/履歷交流區

求職履歷:

  • Richard Liu (LinkedIn)

如果你有 iOS 相關職缺或是求職履歷想要刊登在「13 的開發者週報」,請見關於。

Share this post

開發者週報 #93 WFH 時怎麼樣才不會 WTF

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