Weekly Comment
On January 19th, the Apple Vision Pro finally went on sale. Judging from the response speed of the Apple Store and the estimated delivery time of the product, the initial batch showed signs of being in high demand. Despite its high price, consumers still showed keen interest. However, how long this situation will last and what the public opinion will be after the product is delivered remains to be seen.
As Apple's most significant new product in recent years, the Apple Vision Pro has garnered substantial attention. The stagnation and issues encountered with other products and software over the past couple of years may be attributed to the extensive resources devoted to the development of this product. Its hardware configuration and the experience it offers are unparalleled in the current market, yet its high price also stands unique. Despite the possibility that the Apple Vision Pro might have the lowest profit margin among Apple's recent products, Apple has not opted for subsidizing its hardware cost to boost sales, as seen with gaming console manufacturers, instead aiming to derive long-term profits from software royalties. Therefore, reaching sales in the tens of millions in the next one or two years seems unlikely. This explains why many large development enterprises and streaming platforms maintain a wait-and-see attitude (with no plans yet to provide native applications and services for it). Limited hardware sales constrict third-party involvement. The absence of software and services that fully leverage the device's capabilities can limit hardware sales and prevent cost reduction. This is undoubtedly a situation Apple would prefer to avoid.
Regardless, I sincerely hope that the product will be successful and bring more vitality to the somewhat lackluster Apple ecosystem in recent years.
Last week, Apple also started supporting third-party payments in the US App Store. The implementation details of this policy are similar to those enacted in South Korea two years ago, and from the Korean experience, it did not significantly impact the sales of the App Store. Similarly, it can be foreseen that the policy allowing sideloading to be implemented in the EU in a few weeks will also not cause much upheaval.
On the one hand, large companies need to comply with laws set by governments; on the other hand, they also have sufficient resources to devise strategies that comply with the law but do not overly harm their own interests. In this process, developers and consumers often find themselves in the position of spectators, while legal professionals gain substantial benefits.
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
Relationships in SwiftData: Changes and Considerations
In previous two articles, Mastering Relationships in Core Data: Fundamentals and Mastering Relationships in Core Data: Practical Application, we explored in detail the concepts and techniques of relationships in Core Data. While much of this knowledge is also applicable to SwiftData, Core Data’s successor, SwiftData introduces several significant changes in handling relationships. This article focuses on the changes that have occurred in the aspect of relationships within SwiftData, as well as the potential challenges and noteworthy details arising from these changes.
Recent Selections
How to pass References from Swift to C Functions with Unmanaged Type
This article explores methods for effectively passing references between Swift and C languages. Developer Dimas Ashidiqi, while developing a macOS application using Swift, encountered a unique challenge: the need to use C functions as callbacks, which unlike Swift closures, cannot capture dependencies. To address this issue, Ashidiqi, after thorough research, proposed a solution: converting the self reference in Swift into an UnsafeMutableRawPointer
, and then passing it to the opaque pointer parameter in the C function. In the callback function, this UnsafeMutableRawPointer
can be converted back to its original type. The article not only details this process but also emphasizes the effectiveness and practical value of this method in addressing specific issues encountered in macOS application development.
Remove background from image in SwiftUI
In iOS 17, Apple introduced a striking new feature that allows users to easily extract subjects such as people or animals from photos and videos by long-pressing on them. The API behind this feature has also been made available to developers. In this article, Artem Novichkov thoroughly discusses how to utilize the new iOS 17 API VNGenerateForegroundInstanceMaskRequest
to remove image backgrounds in SwiftUI. By using this powerful tool, developers can implement similar functionalities in their own applications.
App Store screenshot requirements need to change
As the screen sizes and resolutions of iOS devices continue to increase and vary, preparing screenshots for the App Store has become more complex and time-consuming. In this article, Jesse Squires provides a brief overview of the history of iPhone and iPad screen sizes, emphasizing that screen ratio, rather than device size, is the key factor affecting screenshots. He points out that the different screen ratios of various devices mean that the displayed content will significantly differ. Squires believes that the current screenshot requirements of the App Store pose a heavy burden on developers, especially independent ones. He specifically notes that compared to the requirements for the Mac App Store, Apple's regulations for iOS app screenshots are more stringent and cumbersome.
Idle Talk About the Quirks of APPLE's APP REVIEW
In the Epic versus Apple lawsuit, as more insider details were revealed, the veil of mystery surrounding Apple's App Review team has gradually been lifted. In this article, Zhang Siqi (Sketch) reviews and compiles a series of interesting facts and lesser-known information about this team. Topics such as the working data of the App Store review team, the review process, and interpretations of the App Review guidelines are covered. Additionally, the article includes practical advice on handling app rejections, offering guidance to developers navigating the App Store review process.
Notes on SwiftData
In this article, Luke Harback shares his notes and experiences from developing with SwiftData. The article explains how to effectively utilize Swift packages to separate models and application code, thereby optimizing and organizing the code. Additionally, it explores migration techniques and how to define and use models in migration versions through type aliases, among other topics.
Event
Let's visionOS 2024
The first Asian visionOS Developers Conference, "Let's visionOS Conf", co-planned by SwiftGG and XReality Zone, will kick off on March 30, 2024, in Beijing! The event will feature numerous renowned speakers from both domestic and international circles, sharing their practical experiences and industry insights!
In addition to programming technology, the conference content will also encompass product design, human-computer interaction, and commercialization, aiming to help entrepreneurs stand out quickly in the visionOS track!
We eagerly look forward to everyone's participation, whether you are an attendee, sponsor, guest speaker, or volunteer. We warmly welcome you to join us in embracing and exploring this exciting new field!
For more details, please visit the official website of the event.
At that time, I will also attend as a guest speaker to discuss topics related to Observation and SwiftData with everyone.
肘子的话
1 月 19 日,Apple Vision Pro 终于正式开售。从苹果商店的反应速度和产品预计送达时间来看,首批产品显示出供不应求的情况。尽管价格高昂,但消费者仍表现出浓厚兴趣。然而,这种状况能持续多久,以及产品交付后的舆论评价如何,还需时间来验证。
作为近几年来苹果最重要的新产品,Apple Vision Pro 获得了足够的重视。最近一两年,其他产品和软件上的一些停滞和问题,可能也与大量资源投入到该产品的研发有关。其硬件配置和提供的体验在当前市场上无可匹敌,但其高昂的价格也同样独一无二。尽管 Apple Vision Pro 可能是近期苹果所有产品中毛利率最低的,但苹果并未像游戏主机厂商那样,通过价格补贴来提高硬件的销量,然后从软件提成上获取长期利润。因此,在未来一两年内,其销量难以达到千万级别。这也是为什么许多大型开发企业和流媒体平台仍持观望态度的原因( 尚无为其提供原生的应用和服务的计划 )。硬件销量有限,限制了第三方的参与热情。而缺乏能充分展示设备优势的软件和服务,则会限制硬件销售,导致成本无法降低。这无疑是一苹果不愿意看到的情况。
无论如何,我仍然真诚地希望该产品能取得成功,为近年来略显平淡的苹果生态带来更多活力。
上周,苹果在美国的 App Store 也开始支持第三方支付。该政策的实施细则与两年前在韩国实施的政策类似,从韩国的经验来看,这并未对 App Store 的销售产生显著影响。同样可以预见的是,几周后在欧盟实施的允许侧载的政策,也不太可能引起太大波澜。
一方面,大公司需要遵守政府制定的法律;另一方面,它们也有足够的资源来制定符合法律且不过分损害自身利益的操作策略。在这个过程中,开发者和消费者往往处于旁观者的位置,而法律从业者却从中获得了实际利益。
如果您发现这份周报或我的博客对您有所帮助,可以考虑通过 爱发电,Buy Me a Coffee 支持我的创作。
原创
SwiftData 中的关系:变化与注意事项
在之前的两篇文章 掌握 Core Data 中的关系:基础 和 掌握 Core Data 中的关系:实战 中,我们详细探讨了 Core Data 中关系的概念和技巧。虽然这些知识在很大程度上同样适用于 Core Data 的继任者 SwiftData,但 SwiftData 在关系处理上也引入了一些显著的变化。本文将重点介绍 SwiftData 在关系方面发生的变化,以及由此带来的潜在挑战和值得注意的细节。
近期推荐
How to pass References from Swift to C Functions with Unmanaged Type
本文探讨了在 Swift 和 C 语言之间有效传递引用的方法。开发者 Dimas Ashidiqi 在使用 Swift 开发 macOS 应用的过程中,遇到了一个特别的挑战:需要使用 C 函数作为回调,而 C 函数无法像 Swift 的闭包那样捕获依赖项。为了解决这个问题,Ashidiqi 经过深入研究,提出了自己的解决方案:将 Swift 中的 self 引用转换为 UnsafeMutableRawPointer
,再传递给 C 函数中的不透明指针参数。在回调函数中,这个 UnsafeMutableRawPointer
可以被转换回其原始类型。这篇文章不仅详细展示了这一过程,而且特别强调了这种方法在处理 macOS 应用程序开发中遇到的特定问题时的有效性和应用价值。
Remove background from image in SwiftUI
在 iOS 17 中,苹果引入了一项引人注目的新功能,允许用户通过长按照片或视频中的人物、动物等主体内容,轻松将这些内容从照片中提取出来。这一功能背后的 API 同时也向开发者开放。在这篇文章中,Artem Novichkov 详细地探讨了如何利用 iOS 17 的新 API VNGenerateForegroundInstanceMaskRequest
来在 SwiftUI 中去除图像背景。开发者使用这个强大的工具,可以在他们自己的应用中实现类似的功能。
App Store screenshot requirements need to change
随着 iOS 设备屏幕尺寸和分辨率的不断增加和变化,为 App Store 准备截图已经变得更加复杂和耗时。Jesse Squires 在这篇文章中对 iPhone 和 iPad 的屏幕尺寸历史进行了简要回顾,强调屏幕比例而非设备大小是影响截图最关键的因素。他指出,不同设备的不同屏幕比例意味着显示的内容会有显著差异。Squires 认为,App Store 当前的截图要求对开发者,尤其是独立开发者来说,构成了沉重负担。他特别指出,与 Mac App Store 的要求相比,苹果对于 iOS 应用的截图规定更为严格和繁琐。
闲话 APPLE 的 APP REVIEW 趣事
在 Epic 与 Apple 的官司中,随着更多内幕的披露,Apple 的 App Review 团队的神秘面纱逐渐被揭开。在这篇文章中,张思琦(Sketch)回顾并整理了关于这个团队的一系列有趣信息和冷知识。诸如 App Store 审核团队的工作数据、审核流程、以及 App Review 指南的解读等话题。此外,文章还包括关于应对拒审的实用建议,为开发者在面对 App Store 审核时提供指导。
Notes on SwiftData
在这篇文章中,Luke Harback 分享了他在使用 SwiftData 进行开发时的一些笔记和经验。文章介绍了如何有效利用 Swift 包来分离模型和应用代码,从而实现代码的优化和组织。此外,文章还探讨了迁移技巧,以及如何通过类型别名在迁移版本中定义和使用模型等其他内容。
活动
Let's visionOS 2024
由 SwiftGG 和 XReality Zone 共同策划的第一届亚洲 visionOS 开发者大会【Let's visionOS Conf】将于2024.3.30日在北京拉开帷幕!届时会邀请国内外多名大咖来分享他们的实战经验和行业洞见!
会议内容除了编程技术,还会包括产品设计,人机交互和商业化等内容,旨在帮助创业者们在 visionOS 赛道中尽快脱颖而出!
十分期待大家的到来,不论您是参会者,赞助商,演讲嘉宾,还是志愿者,我们都诚挚的欢迎你们与我们共同迎接和探索这个全新的领域!
详情请访问本次活动的官网。
届时,肘子也将作为演讲嘉宾出席,与大家一起探讨 Observation 和 SwiftData 方面的相关内容。