Weekly Comment
A Spectacular Keynote, Yet Practical Implementation Requires Time
Yesterday, WWDC 2024 unfolded as scheduled. In the first keynote, artificial intelligence shone as the brightest star. Apple integrated AI technology into various system areas in a rather natural way, maintaining existing user habits unaltered and fully utilizing the contextual information provided by devices. To enhance user privacy, cloud-based AI capabilities are not relied upon unless the device’s local AI is insufficient. Even when accessing the internet, Apple pledged to strictly protect user privacy. In embracing AI, Apple has not loosened its longstanding focus on privacy.
Beyond AI, major upgrades were received by Swift, VisionOS, Xcode, SwiftData, SwiftUI, and more. Judging solely from the information provided in the keynote, this year’s updates from Apple were highly sincere.
However, it is regrettable that many new functions and features were not released with the first version of the test. Functions related to AI will take some time to be experienced, while others won’t be available until next year.
Surprisingly, Apple has made significant adjustments to SwiftData, which was only released last year, by overhauling its underlying architecture. From the currently available APIs, it's clear that SwiftData is no longer just a variant of Core Data. The newly introduced DataStore protocol allows developers to build customized storage solutions. However, possibly due to the extensive nature of these changes, SwiftData has shown instability in its first test version, and it is recommended that developers wait at least 1-2 months before delving deeper.
Overall, this year's WWDC has introduced many new developments, and the information currently available showcases great potential while also highlighting Apple's strong commitment to technologies like AI, Swift, and SwiftUI. However, whether these innovations will achieve their anticipated outcomes still requires time to assess.
Previous Issue|Newsletter Archive
If you appreciate my work and want to promote your product to the Swift and iOS developer community, sponsoring my platform could be an excellent opportunity for you.
Your support through Patreon, or Buy Me a Coffee helps keep this newsletter and blog running. Thank you for finding this content helpful!
WWDC 2024
What's new in Swift 6.0?
Swift 6.0 introduces a multitude of significant updates, necessitating adjustments in almost every project. As always, Paul Hudson promptly provides a detailed overview of these changes. The release of Swift 6 brings new opportunities and challenges, aiding developers in more efficiently writing concurrency-safe code.
Additionally, Paul has created a demo file using an Xcode playground to showcase the new features of Swift 6, which you can find here, allowing everyone to visually learn and experience these updates.
What is New in SwiftUI After WWDC 24
WWDC 2024 brought several enhancements to SwiftUI. Majid Jabrayilov promptly provided a detailed introduction to several particularly noteworthy new features, including custom containers, a brand-new Tab design, precise control over scroll container positions, the Entry macro, and the Previewable macro. These updates aim to further optimize the experience for developers using SwiftUI.
iOS 18: Notable UIKit Additions
Despite the growing importance of SwiftUI, Apple has not abandoned UIKit. In this article, Jordan Morgan provides a detailed overview of the new features in UIKit for iOS 18.
Recent Selections
TCA Frequently Asked Questions
The Composable Architecture (TCA) framework has received mixed reviews and sparked controversy within the industry. As the creators of TCA, the Point-Free team believes that application architecture involves significant trade-offs, and it is crucial to think deeply about the advantages and disadvantages of each choice. To this end, they have written this article to systematically address some common concerns and misconceptions about TCA on the web.
Swift Concurrency Hack for Passing non-sendable Closures
This article discusses a common warning encountered in Swift concurrency programming: "Capture of ‘variable’ with non-sendable type in a @Sendable
closure." Jesse Squires shares how he came across this warning in his project and the solutions he found. The article outlines two solutions: one involves declaring a type as @unchecked Sendable
to wrap the function; the other directly marks the closure as @Sendable
and @MainActor
, using MainActor.assumeIsolated { }
to invoke the closure.
Core Image: The Basics
Core Image is a powerful image processing framework that achieves high performance through multicore parallel processing and GPU acceleration. In this article, Jacob Bartlett provides a detailed guide to help developers understand and master the Core Image framework, enabling efficient image processing and unique visual effects in applications.
Addressing and Solving Transferable Protocol Issues in iOS 17
Apple introduced a new protocol called Transferable in the Core Transferable framework to simplify code for sharing across apps. It deeply integrates with SwiftUI's ShareLink and other framework protocols like Codable. In this article, JuniperPhoton not only introduces how to use this API but also shares a specific pitfall he encountered in iOS 17 and the solution to it.
肘子的话
Keynote 精彩纷呈,实际应用尚需时日
昨天,WWDC 2024 如期举行。在首场 Keynote 中,人工智能成为了最耀眼的明星。苹果以一种较为自然的方式,将 AI 技术融入系统的各个领域,同时保持现有用户习惯不受影响,并充分利用了设备提供的上下文信息。为了更好地保护用户隐私,除非设备的本地 AI 能力不足,否则不会依赖云端 AI 算力。即便需要访问网络,苹果也承诺将严格保护用户隐私。苹果在拥抱 AI 的同时,并没有放松其对隐私的一贯重视。
除了 AI 技术之外,Swift、VisionOS、Xcode、SwiftData、SwiftUI 等都获得了重大升级。仅从 Keynote 提供的信息来看,今年的苹果更新显示了极高的诚意。
然而,遗憾的是,许多新功能和特性并未随第一版测试版本一同发布。与 AI 相关的功能还需要一段时间才能得到体验,有些功能则要等到明年才能使用。
出乎意料的是,苹果对去年刚发布的 SwiftData 进行了巨大的调整,重构了其底层表述。从目前公开的 API 来看,SwiftData 已经不再仅是 Core Data 的一个变体,新引入的 DataStore 协议允许开发者构建自定义的存储解决方案。然而,可能由于这次改动幅度过大,SwiftData 在首个测试版本中表现出了不稳定性,建议开发者至少等待 1-2 个月后再开始深入研究。
总体而言,今年的 WWDC 带来了众多新动向,当前公开的信息显示了极大的潜力,同时也突显了苹果对 AI、Swift、SwiftUI 等技术的全力投入。然而,这些创新是否能实现其预期的效果,我们还需时日来进行验证。
如果您发现这份周报或我的博客对您有所帮助,可以考虑通过 爱发电,Buy Me a Coffee 支持我的创作。
WWDC 2024
Swift 6 新功能介绍 ( What's new in Swift 6.0? )
Swift 6.0 带来了众多重大更新,这意味着几乎每个项目都需要进行相应的调整。如同以往,Paul Hudson 第一时间为我们详细介绍了这些变化。Swift 6 的发布不仅带来了新的机遇与挑战,还将帮助开发者更高效地编写并发安全的代码。
此外,Paul 还制作了一个使用 Xcode playground 演示 Swift 6 新特性的 演示文件,方便大家直观地学习和体验这些更新。
WWDC 24 上 SwiftUI 的新亮点 ( What is New in SwiftUI After WWDC 24 )
WWDC 2024 为 SwiftUI 带来了多项增强功能。Majid Jabrayilov 及时为我们详细介绍了其中几个特别引人注目的新功能,包括自定义容器、全新的 Tab 界面设计、滚动容器的精确位置控制、Entry 宏以及 Previewable 宏等。这些更新旨在进一步优化开发者使用SwiftUI的体验。
iOS 18:值得注意的几个新功能 ( iOS 18: Notable UIKit Additions )
尽管 SwiftUI 的重要性不断提升,但苹果并未放弃 UIKit。在这篇文章中,Jordan Morgan 详细介绍了 iOS 18 中 UIKit 的几项新功能。
近期推荐
TCA 常见问题解答 ( Composable Architecture Frequently Asked Questions )
对于流行的 Composable Architecture (TCA) 框架,业界存在褒贬不一的评论和争议。作为 TCA 的作者,Point-Free 团队认为,应用架构充满了权衡,关键是深入思考每种选择所带来的利弊。为此,他们撰写了这篇文章,系统地解答网络上关于 TCA 的一些常见疑虑和误解。
Swift 并发处理传递非可发送闭包的方法 ( Swift Concurrency Hack for Passing non-sendable Closures )
本文讨论了在 Swift 并发编程中遇到的一个常见警告:“Capture of ‘variable’ with non-sendable type in a @Sendable
closure.”。Jesse Squires 在项目中遇到了这个警告,并分享了解决方案。文章中给出了两种解决方案:第一种是通过声明一个 @unchecked Sendable
类型来包装函数;第二种是直接将闭包标记为 @Sendable
和 @MainActor
,并使用 MainActor.assumeIsolated { }
来调用闭包。
Core Image:基础 ( Core Image: The Basics )
Core Image 是一个强大的图像处理框架,通过多核并行处理和 GPU 加速,实现高性能的图像处理。在本文中,Jacob Bartlett 提供了详细的指南,帮助开发者了解并掌握 Core Image 框架,以便在应用中实现高效的图像处理和独特的视觉效果。
解决 iOS 17 中 Transferable 协议问题 (Addressing and Solving Transferable Protocol Issues in iOS 17)
Apple 在 Core Transferable 框架中引入了一个新的协议 Transferable,以简化跨应用共享的代码。它与 SwiftUI 的 ShareLink 以及其他框架协议如 Codable 深度结合。在本文中,JuniperPhoton 不仅介绍了该 API 的使用方法,还分享了他在 iOS 17 上遇到的一个特定陷阱及其解决方案。
认证
Apple Ads 认证
Apple Ads 认证是苹果提供的一个免费的在线培训,可帮助你在 App Store 中有效推广你的 app 并触达更多用户。培训课程包含了丰富的推荐做法,可以有效帮助你提升广告系列效果,每节课程耗时约为 10-20 分钟。
征集
《WWDC24 内参》免费领取及作者&审核招募
今年老司机技术会继续和大家一起创作《WWDC24 内参》,他们的目标依旧是创作更多精品的内容。目前以 ChatGPT 为代表的 AI 已经可以完全胜任简单的翻译工作了,因此老司机技术需要一些有实际经验或者资深的开发者,针对今年最新的 WWDC 进行深度解读。就如去年 招募稿 中提到的一样『不断新高的付费用户量不是其终极目标』,终极目标是『为支持我们的朋友免费提供高质量的精品内容』。
今年的《WWDC24 内参》以及往年所有的内参都可以通过:
关注「老司机技术」公众号,并回复「2024」即可免费领取《WWDC24 内参》及往年所有内参
老司机技术今年将继续从公开渠道 招募 一些新的同学,参与到创作《WWDC24 内参》的活动中来。在参与这个过程中,你不仅可以把你过去积累的经验分享给更多人,对于写作能力有待提高的同学还会有 2+ 位资深的审核同学协助你一起创作出一篇高质量文章。