Fatbobman's Swift Weekly #063
Weekly CommentMaking Swift Stronger, Keeping It Simple 2024 marks the sixth year since I received a kidney transplant. Reflecting on this year, my personal health has been stable and smooth. As the year drew to a close, I received two exciting pieces of news—two groundbreaking advancements in xenotransplantation of kidneys, which fill me with hope for the future:
Kidney transplantation is the most ideal treatment for patients with uremia. However, the shortage of donor organs means that many patients cannot receive transplant surgery in a timely manner. To address this challenge, the scientific community has been exploring multiple avenues, with xenotransplantation undoubtedly being the most promising path. With the rapid advancement of gene-editing technology, the progress in xenotransplantation has accelerated. In recent years, this field has made continuous progress. However, despite the relentless efforts of researchers, until today, there have been no successful long-term survival cases of live transplants. Towana Looney's case is undoubtedly a milestone breakthrough. She was not only a kidney donor in the past but has now become a beneficiary of xenotransplantation, making her the best witness to this technological breakthrough. Her resilience and courage bring hope to millions of patients waiting for organs. As a transplant patient myself, I sincerely wish her a speedy recovery and a return to a warm family life. At the same time, I am deeply grateful to all the researchers, doctors, and team members involved in the research and treatment of xenotransplantation. It is their selfless dedication and continuous innovation that have allowed us to see the light in the face of such a significant challenge. I firmly believe that as xenotransplantation technology continues to mature, more patients like Towana will be reborn through this technology in the future. Previous Issue|Newsletter Archive This Week’s SponsorThe Midst: Share Locally, Connect GloballyThe Midst redefines instant messaging with a geo-focused twist! Posts are tied to your location, visible only to those exploring your area. As both an info hub and a megaphone for your ideas, The Midst is perfect for sharing breaking news or spontaneous thoughts. With posts disappearing after 24 hours, the platform remains fresh and dynamic. OriginalsTraps and Countermeasures for Abnormal onAppear Calls in SwiftUI
Recent SelectionsThe Ultimate Guide to Validation Patterns in SwiftUIValidation ensures that applications handle accurate and meaningful data by providing clear feedback to help users correct invalid input and enhance the user experience. Mohammad Azam showcases several validation patterns available in SwiftUI, ranging from simple form validation to advanced real-time feedback and reusable component implementations. Azam also draws inspiration from Flutter’s live validation and ASP.NET’s model validation methods, highlighting the importance of cross-framework learning. This article serves as a powerful guide for developers to build efficient validation mechanisms. SwiftUI Data Flow: Passing Data Between ViewsData flow is a key topic of discussion in SwiftUI. Matteo Manferdini provides a detailed overview of common SwiftUI data transfer mechanisms, including Xcode Library Customization with SPM PluginBy implementing the Noncopyable Types in SwiftIn Swift, types are copyable by default. However, in certain scenarios, copyability can lead to issues. To address this, Swift 5.9 introduced noncopyable types, offering developers stricter ownership control. Natalia Panferova provides an in-depth explanation of the usage and considerations of noncopyable types. While these types might not be suitable for every project, they are a highly effective tool for scenarios requiring unique ownership, enhancing code safety and efficiency. Sending vs Sendable in SwiftThe Creating a SwiftUI Text View with Tappable LinksWhile developers can directly use Markdown text within 肘子的话异种肾脏移植取得突破 2024 年是我接受肾脏移植后的第六个年头。回望这一年,个人的健康状况平稳顺遂。就在岁末之际,我看到了两则令人振奋的消息——两项异种肾脏移植的突破性进展,让我对未来充满希望:
肾移植是尿毒症患者最理想的治疗方案。然而,供体器官短缺的困境,让众多患者无法及时获得移植手术的机会。为应对这一挑战,科技界在多个方向上开展探索,其中异种器官移植无疑是最令人期待的一条路径。 随着基因编辑技术日新月异,异种器官移植的步伐也随之加快。近年来,这一领域取得了持续的进展。然而,尽管科研工作者不懈努力,直至今日,仍未出现长期存活的活体移植成功案例。 Towana Looney 的病例无疑是一个具有里程碑意义的突破。她不仅曾是一位肾脏捐献者,如今又成为了异种移植的受益者,堪称这项技术突破的最佳见证者。她的坚韧与勇气为千万等待器官的患者带来了希望。作为一名移植患者,我由衷祝愿她早日康复,重返温暖的家庭生活。 与此同时,我也深深感激所有投身异种器官移植研究与治疗的科研人员、医生和团队成员。正是因为他们的无私奉献与持续创新,才让我们在面对如此重大挑战时看到了曙光。我坚信,随着异种器官移植技术的日渐成熟,未来将有更多像 Towana 这样的患者,因这一技术而获得重生。 本期赞助The Midst: 本地分享,全球连接The Midst 是一个与众不同的即时信息网络,专注地理位置。你的帖子自动绑定当前位置,只有当其他用户将地图移动到你所在区域时,才能发现你的内容。移动地图,轻松了解各地热议话题。The Midst 是信息的前沿,也是心情的窗口。无论是周围新鲜事,还是灵光一现的想法,尽在 The Midst。帖子 24 小时后自动消失,让信息始终新鲜有活力。 原创SwiftUI onAppear 异常调用的陷阱与应对策略
近期推荐SwiftUI 验证模式终极指南 (The Ultimate Guide to Validation Patterns in SwiftUI)验证确保应用处理的是准确且有意义的数据,通过提供清晰的反馈,帮助用户修正错误输入,提升用户体验。Mohammad Azam 展示了在 SwiftUI 中可以使用的一些验证模式,从简单的表单验证到复杂的实时反馈和复用组件的实现,提供了多种技术方案。同时,Azam 借鉴了 Flutter 的实时校验和 ASP.NET 的模型验证方法,展示了跨框架技术学习的重要性,为开发者提供了构建高效验证机制的有力工具。 SwiftUI 数据流:视图间的数据传递 (SwiftUI Data Flow: Passing Data Between Views)对于 SwiftUI 来说,数据流是一个值得深入探讨的话题。Matteo Manferdini 详细介绍了 SwiftUI 中常用的数据传递机制,包括 使用 SPM 插件自定义 Xcode Library (Xcode Library Customization with SPM Plugin)通过实现 Swift 中的不可复制类型 (Noncopyable Types in Swift)在 Swift 中,类型默认是可复制的。然而,在某些场景中,可复制性可能导致问题。为了解决这些问题,Swift 5.9 引入了不可复制类型(Noncopyable Types),为开发者提供了更严格的所有权控制。Natalia Panferova 在文中详细阐述了不可复制类型的用法和注意事项。虽然不可复制类型可能不适用于所有项目,但在需要确保唯一所有权的场景中,它是一项极为强大的工具,为开发者提供了更高的代码安全性和效率。 Swift 中的 Sending 与 Sendable 比较 (Sending vs Sendable in Swift)Swift 6 中新增的 创建带可点击链接的 SwiftUI 文本视图 (Creating a SwiftUI Text View with Tappable Links)虽然开发者可以直接在 Welcome to my blog Fatbobman's Swift Blog( 肘子的Swift记事本 ) |