SwiftUI 教程

本文作者汇集了众多 SwiftUI 免费教程,包括示例代码、视频等。介绍了适合初学者的教程,如 Apple 官方教程等,也有深入探讨 SwiftUI 语法、构建应用的教程。还列举了相关视频、热门话题讨论,最后指出目前处于 SwiftUI 早期,后续还有很多变化值得期待。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原文:Learn SwiftUI with free tutorials 作者:Paul Hudson

SwiftUI 是在 WWDC19 的主题演讲期间宣布的,我们已经看过大量的免费教程,如文章,YouTube 视频,书籍等等 - 可以肯定的是,人们很兴奋,并且热衷于分享这种兴奋。世界!

我自己一直在创建很多 SwiftUI 教程,但我也一直在阅读许多其他开发人员的教程。在本文中,我试图将来自各个人的教程汇集在一起 ​​,因为每个人都学到了不同的东西 - 希望你能找到一个以适合你的方式教授 SwiftUI 的教程。

SwiftUI 示例

在 SwiftUI 发布后不久,我发布了一篇名为 Get starts with SwiftUI 的文章,其中概述了创建视图,堆栈,列表等的基础知识。

从那时起,我已经制作了大量的 SwiftUI 示例代码和视频:

最近,我一直致力于在 SwiftUI 中创建完整应用程序的视频,以便人们可以看到行动中的概念,而不是孤立的例子。例如:

这些视频不是太长,但仍然有足够的空间来真实展示 SwiftUI 的强大和简洁。这是一个让你入门的例子:

SwiftUI Tutorial: Build a dynamic list app with navigation and images – SwiftUI Complete Apps #1

开始使用 SwiftUI

有很多人在编写教程,旨在帮助您开始使用 SwiftUI。他们在构建内容方面遇到各种难度级别 - 它们都旨在帮助您入门,但有些比其他人更容易!

当然,我应该通过说 Apple 自己的 SwiftUI 教程 非常出色来开始这个列表 - 大量的代码,大量的屏幕截图,甚至测验问题来帮助测试你的学习。

对于绝对的初学者
  • Santosh Botre 为各种 SwiftUI 组件提供了一些很好的示例代码。
  • Sai Kambampati 有一个很好的教程,建立一个有剪裁和阴影的漂亮的列表应用程序。
  • Martin Lasek 撰写了一篇非常轻松的介绍,其中包含大量截图和实验空间。
  • John Sundell 撰写了一篇精彩的初学者教程,向您介绍了各种 SwiftUI 组件的基础知识。
走得更远
  • Mischa Hildebrand 编写了一个教程,专注于 SwiftUI 背后的 Swift 语法的一个特定部分:some 关键字。
  • Majid Jabrayilov 写了一个教程,引导您构建一个用于搜索 GitHub repos 的应用程序。
  • Rohan Panchal 从 React Native 的角度编写了一个接近 SwiftUI 的教程。
  • Audrey Tam 有一个非常简单的教程,但随后会通过状态,组合,警报等向上移动。
  • Benedikt Terhechte 写了一篇文章,从游戏引擎的角度探索 SwiftUI,直接进入堆栈和状态。

影片

我们在 Swift 社区拥有各种各样的视频创作者,很高兴看到他们对 SwiftUI 如此兴奋!

以下是已有的许多 SwiftUI 视频的选择:

每天都会出现包含更多主题的新视频,因此如果您需要定期更新,可能需要订阅其中一些频道。

一般讨论; 一般交流

SwiftUI 上没有结束热门话题,但是少数特别有经验的人花了很多时间从各种角度编写一个更加深思熟虑的视图。

特别是,我喜欢这些:

虽然几乎每个人都对 SwiftUI 持肯定态度,但值得加入一点怀疑 - 请参阅 Jille van der Weerd 对 SwiftUISkeptics 观点

现在在哪里?

JuanpeCatalán 关于 SwiftUI 和 Yogesh Singh 的 Awesome SwiftUI 这样的网站正在出现,以帮助我们跟踪 SwiftUI 可用的许多资源 - 如果你渴望获得更多的 SwiftUI,你应该从那里开始。

但最终,我们只是在 SwiftUI 的早期阶段,我们仍然可以期待在 Xcode 11 GM 的 1.0 版本之前进行大量的更改。我不了解你,但我特别期待 Forms 代码,更多关于常见 UIKit 控件的包装器,以及其余的 Combine 框架掉线!

转载于:https://juejin.im/post/5d0b2646e51d45776031b012

Up to date for iOS 13, Xcode 11 & Swift 5.1 With SwiftUI, you can define what your app’s UI should do with concise, declarative language, and say goodbye to tons of confusing UIKit code. Build modern, responsive UI and animations that look great on iOS, iPadOS, watchOS, tvOS or even macOS! Build fluid and engaging declarative UI for your apps — using less code — with SwiftUI! SwiftUI by Tutorials is designed to help you learn how to transition from the “old way” of building your app UI with UIKit, to the “new way” of building responsive UI with modern declarative syntax with SwiftUI. This book is for readers who are comfortable building Swift apps, and want to make the exciting leap into building their app UI with modern, declarative code. What is SwiftUI? SwiftUI lets you build better apps, faster, and with less code. It’s a developer’s dream come true! With SwiftUI, you can design your user interfaces in a declarative way; instead of developing app interfaces in an imperative way, by coding all of the application state logic before time, you can instead define what your app’s UI should do in a particular state and let the underlying OS figure out how to do it. What’s more is that SwiftUI lets you build modern, responsive UI and animations for all Apple devices — not just iOS. So whether you’re building apps for iOS, watchOS, tvOS or any other Apple platform, you can use the same concise, natural language to describe your UI and have it look stunning — no matter where your code runs. In addition, SwiftUI’s built-in automatic support for things such as dark mode, localization and accessibility, along with Xcode 11 support for drag-and-drop design and instant preview makes it easier to build apps than ever before.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值