排序
智能断点
断点基础 在介绍内容之前,回顾一下设置断点和步进已暂停代码的绝对基础知识。点击任何行号都会激活该行的断点,按 Cmd+\ 也会激活当前行的断点。 当执行到该行时,断点会暂停执行,这时可以使...
Kana Quest
这个 app 用来学习日语中的平假名(hiragana)与片假名(katakana)。 基本用户界面 这个项目的 assets.zip 压缩文件,包含两个重要的文件: kana.json 文件包含我们要使用的所有日语字符。 Bundle-...
单项目集合
代码内有什么? 在 swift 标准库文件 Array.swift 中,可以检索到 insert() 方法,如下所示: public mutating func insert(_ newElement: __owned Element, at i: Int) { _checkIndex(i) self.r...
printing vs dumping
有什么问题? print() 方法有一定的缺点,为了说明这个问题,我们定义一个 Footballer 结构体,结构体包含队员的姓名、位置以及俱乐部,后边的两者是不同的类型。 enum Position { case goal, d...
太空操作符 <=>
spaceship operator <=> (太空操作符) 它是二目运算符,并非三目运算符。 进行三向比较,>、=、<。 常见的运算符分为前缀(prefix)运算符、中缀(infix)运算符、后缀(postfix)运算...
Slice of Pi
我们将制作一个 macOS 应用程序,帮助你记住圆周率的数字。请创建一个新的 macOS 项目,并命名为 SliceOfPi。 assets下载 足够的数据记忆圆周率最简单的方法是从字母表中为每个数字指定一个或...
Minesweeper
如果你想继续学习本教程,请使用 App template 创建一个新的 macOS 项目,并将其命名为 Minesweeper。 显示网格 我们的第一步将是显示一个包含棋盘整体布局的方格网格。这些方格中的所有内容都...
Release checklist 版本清单
Sure, all your tests pass, but how can you make sure your app functions properly? Most large projects have a solution called a release checklist, and here I want to share mine wit...
LiveScribe
We're going to build a macOS app that lets users write Markdown and see exactly how it looks as they type. More importantly, we're going to do so using test-driven development, so ...
AutoTranslate
We're going to build an app that translates English into multiple other languages, then exports it ready for Xcode to use in localizations.我们将构建一个应用程序,将英语翻译成多种...