swift学习-第一部分纪要

  • 第一节介绍 swift 工程的结构,包括我们看到的结构和概念上的结构,并介绍 swift 中重要的基本概念: variables and functionsscopes and namespacesobject Type and their instances.

  • 第二节介绍 swift 方法,介绍方法声明和调用,讨论方法的参数,包括external parameter names,default parameters and variadic parameters.然后再深入学习 swift 强大的方法,with an explanation of functions inside functions, functions as first-class values, anonymous functions, functions as closures, curried functions, and function references and selectors.

  • 第三节开始介绍 swift 变量,变量生效范围及生命周期,如何声明和初始化一个变量,以及 computed variablessetter observers 的功能; 介绍 swift 中内置的重要类型,包括 Booleansnumbersstringsrangestuples and Optionals.

  • 第四节介绍 swift 的对象类型,classesstructsenums,包括这三种类型如何声明、初始化、使用以及如何工作;然后介绍polymorphismcasting、协议、泛型和扩展,最后介绍了 swift 的保护类型(concludes with a discussion of swift's umbralle types -),比如 AnyAnyObject; 以及集合类型,Array、Dictionary、Set(including option sets)

  • 第5节是杂项。 我们从 Swift 的用于分支,循环和跳转的流控制结构开始,包括错误处理。 然后,我描述了 Swift访问控制(隐私),自省(反射)以及如何创建自己的运算符。 接下来,我谈论 Swift内存管理。 本章以对一些最近添加的 Swift语言功能的调查为结尾:合成协议实现,键路径,动态成员,属性包装器,自定义字符串插值,反向泛型,函数构建器和结果。(Chapter 5 is a miscellany. We start with Swift’s flow control structures for branching, looping, and jumping, including error handling. Then I describe Swift access control (privacy), introspection (reflection), and how to create your own operators. Next I talk about Swift memory management. The chapter ends with a survey of some recently added Swift language features: synthesized protocol implementations, key paths, dynamic members, property wrappers, custom string interpolation, reverse generics, function builders, and Result.

你可能感兴趣的:(swift学习-第一部分纪要)