导语
这篇文章是方便自己学习理解苹果开发者的文档的笔记,希望能给有需要的同学一些帮助,因为自己翻译理解的内容,必然存在一些不足,还望指出。
Apple Developer
(https://developer.apple.com/)苹果开发者网站
笔记
Framework Swift
Overview(综述)
Swift includes modern features like type inference, optionals, and closures, which
make the syntax concise yet expressive. Swift ensures your code is fast and efficient,
while its memory safety and native error handling make the language safe by design.
Writing Swift code is interactive and fun in Swift Playgrounds, playgrounds in Xcode,
and REPL.
*注释
Swift 包含现代化的产品产品特征例如类型推理,可选择性以及封闭性,它的语法简洁但极具表现
力。Swift 确保你的代码是简洁并且有效率的,当它的内存安全且自然的处理错误确保语言安全通
过设计。编写 Swift 代码是富有交互性和乐趣的在 Swift 的游乐场里,这个游乐场就是Xcode和
REPL。
Learn Swift(学习 Swift)
If you're new to Swift, read The Swift Programming Language for a quick tour, a
comprehensive language guide, and a full reference manual. If you're new to
programming, check out Swift Playgrounds on iPad.
Swift is developed in the open. To learn more about the open source Swift project and
community, visit Swift.org.
*注释
如果你是才开始学习Swift,或者几小时内很快地浏览了 Swift 工程语言,有广泛的语言做指导,
并且有完备的参考手册。如果你正在做一个新项目,在Ipad上选择 Swift Playground。
Swift 是一个开源项目。想要了解更多关于开源 Swift 项目和社区,前往 Swift.org。
Topics(种类)
Standard Library(标准库)
struct Int
struct Double
struct String
struct Array
struct Dictionary
Data Modeling(数据模式)
Choosing Between Structures and Classes
Decide how to store data and model behavior.
描述了如何储存数据和模式行为。
Adopting Common Protocols
Make your custom types easier to use by ensuring that they conform to
Swift protocols.
通过符合 Swift 协议来确保你自定义的类别更加容易的去使用。
Data Flow and Control Flow(数据流和控制流)
Maintain State in Your Apps
Use enumerations to capture and track the state of your app.
通过枚举来获取和追踪你的 app 属性
Preventing Timing Problems When Using Closures
Understand how different API calls to your closures can affect your app.
理解不同的API怎样回调你的终止进程能影响你的app。
Language Interoperability(语言互用)
Object-C and C Code Customization
Apply macros to your Objective-C APIs to customize how they're imported
into Swift.
申请宏命令给你的 Object-C APIs 给到 Swift 引入的自定模块中。
Migrating Your Object-C Code to Swift
Learn the recommended steps to migrate your code.
了解推荐步骤来迁移你的代码。
Cocoa Design Patterns
Adopt and interoperate with Cocoa design patterns in your Swift apps.
采用 Cocoa 合作设计交互操作在你的 Swift apps 中。
Handling Dynamically Typed Methods and Objects in Swift
Cast instances of the Objective-C id type to a specific Swift type.
投射实例化的 Object-C 的 id 类别到一个特殊的 Swift 类别中去。
Using Object-C Runtime Features in Swift
Use selectors and key paths to interact with dynamic Objective-C APIs.
使用选择器和交互的关键路径在动态的 Object-C APIs。
Imported C and Object-C APIs
Use native Swift syntax to interoperate with types and functions in C
and Objective-C.
使用原生的 Swift 语法来交互操作在 C 和 Object-C 中的类别和函数。
Structures(结构)
struct CollectionDifference
Reference(参考)
Swift Standard Library Functions
This chapter describes the global functions defined in the Swift standard
library.
这些章节描述了在 Swift 标准库中的全局函数声明。
具体内容学习
(https://www.w3cschool.cn/)w3cschool