中文位于文章的下半部分
Weekly Commen
On October 31, Apple held the shortest product launch in history. As expected, Apple released the MacBook Pro and iMac based on the M3 chip.
Based on the data, the M3 chip shows moderate improvement in the CPU aspect, but its GPU performance is outstanding, especially with hardware-level ray tracing support.
I speculate that the Apple Vision Pro to be released next year will likely use this M3 chip, which can not only further enhance the visual effects of Apple Vision Pro, but also help with battery life. To compete with the low price of Meta Quest 3, Apple must show sufficient performance advantages for Apple Vision Pro.
In addition to hardware specifications, my main concern about Apple Vision Pro comes from the imperfection of development tools. The progress of the SDK is slow, the promised Unity support has not yet been implemented, and the functions of Reality Composer Pro are far from meeting expectations. Overall, although Apple seems to have made some layout for the development ecosystem of Vision Pro, it is far from enough.
The 27-inch iMac still has not appeared, and Apple may have completely abandoned this product. If a large-size iMac will be launched in the future, I estimate that the size will exceed 32 inches.
Previous Issue|Newsletter Archive
If you find this weekly newsletter or my blog helpful, I would greatly appreciate your consideration of making a donation through Patreon, or Buy Me a Coffee.
Originals
How to Observe Data Changes in SwiftData Using Persistent History Tracking
When there are changes in the database, Persistent History Tracking will send notifications to the subscribers. Developers can use this opportunity to respond to modifications made to the same database, including other applications, widgets (in the same App Group), and batch processing tasks. Since SwiftData integrates support for Persistent History Tracking, there is no need to write additional code. Subscription notifications and transaction merges will be automatically handled by SwiftData.
However, in some cases, developers may want to manually respond to transactions tracked by Persistent History Tracking for more flexibility. This article will explain how to observe specific data changes through Persistent History Tracking in SwiftData.
Recent Selections
The Absolute Minimum Every Software Developer Must Know About Unicode in 2023 (Still No Excuses!)
Unicode was first released in 1991 as a standard aimed at unifying all historical and current human languages for use on computers. Thirty years have passed, and Swift is still the only language among all mainstream languages that can correctly determine the length of "🤦🏼♂️". One reason for this is that Swift made support for Unicode one of its core features from the beginning. Another reason is that Unicode is updated annually, with changes in its specifications, requiring the language development teams to continuously invest effort in maintaining updates to the Unicode character set.
In this article, Nikita thoroughly introduces the basic knowledge of Unicode that programmers need to know in 2023. This is a very valuable article, and I strongly recommend every programmer to read it. It covers key concepts of Unicode, as well as issues to pay attention to in actual development.
The Story of Being Rejected by AppStore for the Reason of 4.3
For a developer, submitting their carefully developed application to the App Store only to be rejected for violating guideline 4.3 is far from a pleasant memory. Kiecooboi also encountered this issue when submitting his first app. Whether through the website or email appeals, the reason for rejection was the same: "shares a similar binary, metadata, and/or concept as apps submitted to the App Store by other developers." After multiple attempts, Kiecooboi finally had the opportunity to speak with the reviewer over the phone. Through the conversation, it was revealed that the issue was simply because the reviewer deemed the use of Twitter for support URLs inappropriate. After making the necessary changes, the app was successfully published. Kiecooboi documented this experience on Discord. With the author's permission, I have shared this account on Twitter in the hopes that it may be helpful to others.
Swift, meet WinRT
The Windows Runtime (WinRT) is based on the Component Object Model (COM) API, which is designed to be accessed through language projections. Projections hide the details of COM and provide a more natural programming experience for a given language. The Browser Company has built a language projection tool for creating idiomatic Swift language bindings for WinRT and has applied it to develop a Windows version of Arc. This tool is now open source and available at https://github.com/thebrowsercompany/swift-winrt. In this article, Steve Kirbach first introduces the history of Windows desktop development, discusses the possibility of using Swift for development on Windows, and provides a complete end-to-end example demonstrating how to use the Swift/WinRT code generator and WinUI 3.
The Browser Company is committed to applying Swift to the Windows platform. In the second issue of our newsletter, we also introduced their another article about using Swift on Windows: Interoperability: Swift’s Super Power.
Advanced SwiftUI Animations – Part 7: PhaseAnimator
In WWDC 2023, the animation capabilities of SwiftUI have been significantly enhanced, including the introduction of PhaseAnimator. PhaseAnimator view and the phaseAnimator modifier use a series of phase information provided by developers to achieve animated effects on content, playing continuously or triggered, with each phase defining a discrete step in the animation. In this article, Javier provides a detailed introduction to the usage of phase animations and also points out a potential issue that may arise when using the Text view in phase animations, along with a solution.
Promotional offers: Increase App Revenue using discounts
Promotional offers can provide discounted prices for auto-renewable subscription products. They can effectively attract lapsed subscribers or retain current subscribers and bring in more profits when implemented correctly. In this article, Antoine van der Lee explains the concept of promotional offers, demonstrates how to configure them in App Store Connect, recommends some related documentation for implementing promotional offers, and shares a few common methods to increase revenue. This article is suitable for every developer who wants to increase app revenue.
Creating Shortcuts with App Intents
Shortcuts allow users to interact with your application without launching and navigating to specific screens to perform tasks. In the past, adding and exposing shortcuts to the system was cumbersome and time-consuming. In iOS 16, Apple has improved the process of adding and exposing application shortcuts to iOS. The new App Intents framework allows developers to create shortcuts using the same language (Swift) that you use every day! Everything is statically-typed and can be received by iOS upon installation. In this article, Mark Struzinski will show you how to add shortcuts to your app using the App Intents framework through a complete example.
肘子的话
在10月31日,苹果举办了有史以来最短的产品发布会。如预期,苹果发布了基于 M3 芯片的 MacBook Pro 和 iMac。
就数据来看,M3 芯片在 CPU 方面的提升中规中矩,不过 GPU 性能表现出色,特别是提供了硬件级别的光线追踪支持。
我推测,明年发布的 Apple Vision Pro 很可能会使用这款 M3 芯片,这不仅能进一步提高 Apple Vision Pro 的视觉效果,还可能对续航时间有所帮助。为了应对 Meta Quest 3 的低价格,苹果必须让 Apple Vision Pro 展现出足够的性能优势。
除了硬件规格,我对 Apple Vision Pro 的担忧主要来自开发工具的不完善。SDK 的进展缓慢,承诺的 Unity 支持尚未实现,Reality Composer Pro 的功能远未达到预期。总的来说,尽管苹果似乎已经为 Vision Pro 的开发生态做了一些布局,但还远远不够。
27 英寸的 iMac 仍然未出现,可能苹果已经彻底放弃了这款产品。如果未来还会推出大尺寸的 iMac,我估计尺寸会超过 32 英寸。
如果您发现这份周报或我的博客对您有所帮助,可以考虑通过 Patreon, Buy Me a Coffee, 微信 支持我的创作。
原创
如何通过 Persistent History Tracking 观察 SwiftData 的数据变化
在数据库发生变化时 Persistent History Tracking( 持久化历史跟踪 )会向订阅者发送提醒,开发者可以借此机会对同一数据库进行的修改做出响应,包括其他应用、组件(同一个 App Group)和批处理任务。由于 SwiftData 集成了对持久化历史跟踪功能的支持,无需编写额外的代码,订阅通知、合并事务等工作都会由 SwiftData 自动完成。
然而,在某些情况下,开发者可能希望自行响应持久化历史跟踪的事务,以获得更多的灵活性。本文将介绍如何在 SwiftData 中通过持久化历史跟踪观察特定数据变化的方法。
近期推荐
2023 年每个软件开发者都必须知道的关于 Unicode 的最基本的知识(仍然不准找借口!)
Nikita Prokopov 中文翻译:OverflowCat
Unicode 于 1991 年首次发布,这是一个旨在统一所有历史和现存人类语言的标准,使其能在计算机上使用。30 年过去了,Swift 现在仍是所有主流语言中唯一能正确判断"🤦🏼♂️"长度的语言。部分原因是因为 Swift 在创建时就把对 Unicode 的支持作为其核心功能之一,另一部分原因是 Unicode 每年都在更新,规范也在变化,语言的开发团队必须持续投入精力来维持对 Unicode 码表的更新。
在这篇文章中,作者详尽地介绍了程序员在 2023 年需要了解的 Unicode 的基础知识。这是一篇极具价值的文章,我强烈推荐每位程序员阅读。它涵盖了Unicode 的关键概念,以及在实际开发中需要注意的问题。
记录上架 AppStore 以 4.3 为由被拒的故事
对于一个开发者来说,将自己精心开发的应用提交到 App Store,却因为违反了 4.3 条准则而被拒绝,这绝不是一个美好的回忆。Kiecooboi 在提交他的首个应用时也遇到了这个问题。无论通过网站还是邮件申诉,拒绝的理由都是相同的:“shares a similar binary, metadata, and/or concept as apps submitted to the App Store by other developers”。经过多次尝试后,Kiecooboi 终于获得了与审核人员通话的机会。通过电话沟通,发现问题只是因为对方认为支持网址使用 Twitter 不妥当。经过修改后,应用成功上线。他在 Discord 中记录了这次沟通的经历。经过作者同意,我在 Twitter 上转载了这篇经历,希望对大家有所帮助。
Swift, meet WinRT
Windows 运行时( WinRT )基于组件对象模型 (COM) API,根据设计,可通过语言投影访问它。 投影将隐藏 COM 详细信息,并为给定语言提供更自然的编程体验。The Browser Company 构建了一个语言投影工具,用于为 WinRT 创建符合习惯用法的 Swift 语言绑定,并将其应用于开发 Arc 的 Windows 版本中。该工具现已开源并发布在https://github.com/thebrowsercompany/swift-winrt。在这篇文章中,Steve Kirbach 首先介绍了 Windows 桌面开发的历史,探讨了在 Windows 上使用 Swift 进行开发的可能性,并提供了一个完整的端到端示例,展示了如何使用 Swift/WinRT 代码生成器和 WinUI 3。
The Browser Company 正在致力于将 Swift 应用于 Windows 平台,在周报的第二期中,我们还介绍了他们的另一篇关于在 Windows 上使用 Swift 的文章:Interoperability: Swift’s Super Power。
Advanced SwiftUI Animations – Part 7: PhaseAnimator
在 WWDC 2023 中,SwiftUI 的动画功能得到了显著的增强,其中包括本文介绍的阶段动画(PhaseAnimator)。PhaseAnimator 视图和 phaseAnimator 修饰器使用开发者提供的一系列阶段信息来实现内容的动画效果,并持续或触发式地进行播放,每个阶段定义了动画中的一个离散步骤。在这篇文章中,Javier 对阶段动画的使用方法进行了详尽的介绍,他还指出了在阶段动画中使用 Text 视图可能出现的一个潜在问题,并提供了解决方案。
Promotional offers: Increase App Revenue using discounts
促销优惠可以为自动续订订阅产品提供折扣价格。它们能有效地吸引回流的订阅者或保留当前的订阅者,并在操作得当时带来更多利润。在这篇文章中,Antoine van der Lee 解释了促销优惠的概念,展示了在 App Store Connect 中配置促销优惠的方法,并推荐了一些实现促销优惠的相关文档,还分享了几种常见的增加收入的方法。本文适合每一个希望增加 App 收入的开发者。
Creating Shortcuts with App Intents
快捷方式允许用户在不启动和导航到特定屏幕以执行任务的情况下与你的应用程序进行交互。过去,添加快捷方式并将其暴露给系统会比较麻烦和耗时。在 iOS 16 中,Apple 改进了向 iOS 添加和暴露应用程序快捷方式的过程。新的 App Intents 框架允许开发者使用你日常使用的相同语言(Swift)创建快捷方式!一切都是静态类型的,并且在安装时即可被 iOS 接收。在本文中,Mark Struzinski 将通过一个完整的示例向你展示如何通过 App Intents 框架为应用添加快捷方式。
友情推广
SwiftGG 纳新了!
SwiftGG 一直尝试将社区里有前瞻性的,有价值的内容呈现到大家视野中,除了会邀请国内各个领域的大牛,还会努力成为与国外优秀创作者建立联系的纽带,以更宽广,更国际化的视角来丰富创作者们的视野。近期 SwiftGG 将向整个技术社区开放纳新,这次开放的岗位有:
内容创作和生产项目组负责人一名
技术支持项目组负责人一名
线上和线下活动项目组
运营增长项目组负责人一名
内容创作和生产项目组成员 3-5 名
技术支持项目组成员若干名 3-5 名
线上和线下活动项目组若干名 3-5 名
运营增长项目组若干名 3-5 名
如果你对 SwiftGG 的理念认同,请往 zhangsiqi1988@gmail.com 投递你的简历,目标职位和个人介绍吧!
PS:SwiftGG 正在筹备 2024 年的面向全亚洲的,全线下的 Apple 开发者生态大会。请关注他们的新网站以获取更多信息:https://swiftgg.team 。