Fatbobman's Swift Weekly #064
Weekly CommentHappy New Year 2025
Despite the unrest in the world, 2024 has been a fulfilling and wonderful year for me. Throughout the year, I wrote 47 articles and published 51 weekly newsletters, and I can feel my understanding of Swift and SwiftUI continuously deepening. What brings me the most joy is that my entire family has stayed healthy and well. I wish everyone good health and happiness in 2025. I also look forward to seeing Swift and SwiftUI continue to flourish in the new year. Happy New Year 2025! 🎉 Previous Issue|Newsletter Archive OriginalsWhy Certain View Modifiers in Swift 6 Cannot Use the @State PropertyIn Xcode 16, to improve SwiftUI’s performance under Swift 6 mode, Apple made several adjustments to the SwiftUI framework’s APIs to meet stricter concurrency checks. The most notable change is the comprehensive annotation of the
Recent SelectionsExploring TabView Advancements in SwiftUIAt WWDC 2024, Reading and Displaying Genmoji in Non-Rich Text Formatted Data ContextGenmoji, an innovative feature launched by Apple at WWDC 2024, cleverly combines "generative" and "emoji" technology, enabling users to easily create unique personalized emojis. Based on Crafting a Dissolve Effect in Metal and SwiftUIMetal’s shader system provides developers with powerful tools for creating high-performance, visually stunning effects. In this article, Uladzislau Volchyk explores how to use Metal to implement a dissolve effect, with a focus on the fundamentals of the Metal rendering pipeline. The author uses several diagrams to explain the working principles in detail, while providing complete implementation code, covering key steps such as renderer configuration, writing vertex and fragment shaders, and building the rendering pipeline with enabled blending functionality. Write Swift Like AppleThere are many different code conventions in the Swift programming language. In his years of development experience, Uwais Alqadri found that when working with projects combining UIKit and SwiftUI, the best practice is to follow Apple’s own Swift coding style. Through two articles, he summarizes some of the common practices in Apple’s Swift programming, focusing on sensible naming, concise type inference, and clear protocol design, which allows the code to remain elegant and simple while naturally fitting into Apple’s framework design philosophy. MyTallies Widgets, AppIntents, Siri Shortcuts and WatchKitIn this tutorial series, Stewart Lynch uses a SwiftUI and SwiftData-based counter app, MyTallies, to demonstrate how to build cross-platform functionality within the Apple ecosystem. The tutorial provides a comprehensive guide to developing widgets, implementing AppIntents, integrating Siri Shortcuts, and building WatchKit applications for the Apple Watch, offering clear explanations of these core technologies. 肘子的话2025 新年快乐 尽管世界局势并不平静,2024 对我而言却是一个充实美好的年份。这一年里,我写下了 47 篇文章,发布了 51 期周报,也能感受到自己对 Swift、SwiftUI 的理解在不断深入。而最令我欣慰的,是全家人都健康平安。 祝愿大家在 2025 年都能拥有健康的身体、愉悦的心情。也期待 Swift、SwiftUI 在新的一年里继续蓬勃发展。 2025 新年快乐!🎉 原创为何 Swift 6 中某些视图修饰器无法使用 @State 属性在 Xcode 16 中,为了改善 SwiftUI 在 Swift 6 模式下的表现,苹果对 SwiftUI 框架的 API 进行了多项调整,以满足更严格的并发检查要求。其中最显著的变化是将
近期推荐探索 SwiftUI 中 TabView 的进展 (Exploring TabView Advancements in SwiftUI)在 WWDC 2024 上, 在非富文本环境中解析与展示 Genmoji (Reading and Displaying Genmoji in Non-Rich Text Formatted Data Context)Genmoji 作为苹果公司在 WWDC 2024 重磅推出的创新功能,巧妙地融合了"生成式"(Generative)和"表情符号"(Emoji)技术,让用户能够轻松创建独具特色的个性化表情。该功能基于 在 Metal 和 SwiftUI 中创建溶解效果 (Crafting a Dissolve Effect in Metal and SwiftUI)Metal 的着色器系统为开发者提供了创建高性能、视觉炫丽特效的强大工具。在这篇文章中,Uladzislau Volchyk 探讨了如何利用 Metal 实现溶解特效,并重点讲解了 Metal 渲染管线的基础知识。作者通过多张图表详细解释了工作原理,同时提供了完整的实现代码,涵盖了渲染器的配置、顶点与片段着色器的编写,以及启用混合功能的渲染管线构建等关键环节。 像苹果一样写 Swift (Write Swift Like Apple)Swift 编程语言有许多不同的代码规范。在多年的开发经验中,Uwais Alqadri 发现,混合使用 UIKit 和 SwiftUI 的项目时,最好的做法是遵循苹果自己在 Swift 编程中的编码风格。通过两篇文章,他总结了苹果在 Swift 编程中的一些习惯用法,通过合理命名、简洁的类型推断和清晰的协议设计,让代码既保持优雅简洁,又能自然融入苹果的框架设计理念。 MyTallies Widgets, AppIntents, Siri Shortcuts and WatchKit在这个系列教程中,Stewart Lynch 以一款基于 SwiftUI 和 SwiftData 开发的计数器应用 MyTallies 为基础,全面展示了如何在苹果生态系统中构建多平台功能。教程深入浅出地讲解了小组件(Widgets)的开发、AppIntents 的应用、Siri 快捷指令的集成,以及 WatchKit 手表应用的构建等核心技术。 Swift 官方编程指南 6.0(中文版)SwiftGG 翻译小组 已经完成了 Swift 6.0 版本官方文档的翻译工作。欢迎大家订阅他们的微信公众号《SwiftGG 技术小组》,该公众号将定期发布与 Swift 相关的技术内容。 Welcome to my blog Fatbobman's Swift Blog( 肘子的Swift记事本 ) |