图书介绍
Swift 2 面向对象编程PDF|Epub|txt|kindle电子书版本网盘下载
![Swift 2 面向对象编程](https://www.shukui.net/cover/65/34500106.jpg)
- Gaston C.Hillar著 著
- 出版社: 南京:东南大学出版社
- ISBN:9787564170790
- 出版时间:2017
- 标注页数:309页
- 文件大小:38MB
- 文件页数:325页
- 主题词:程序语言-程序设计-英文
PDF下载
下载说明
Swift 2 面向对象编程PDF格式电子书版下载
下载的文件为RAR压缩包。需要使用解压软件进行解压得到PDF格式图书。建议使用BT下载工具Free Download Manager进行下载,简称FDM(免费,没有广告,支持多平台)。本站资源全部打包为BT种子。所以需要使用专业的BT下载软件进行下载。如BitComet qBittorrent uTorrent等BT下载工具。迅雷目前由于本站不是热门资源。不推荐使用!后期资源热门了。安装了迅雷也可以迅雷进行下载!
(文件页数 要大于 标注页数,上中下等多册电子书除外)
注意:本站所有压缩包均有解压码: 点击下载压缩包解压工具
图书目录
Chapter 1:Objects from the Real World to Playground1
Installing the required software1
Capturing objects from the real world4
Generating classes to create objects11
Recognizing variables and constants to create properties14
Recognizing actions to create methods17
organizing classes with UML diagrams20
Working with API objects in the Xcode Playground26
Exercises31
Test your knowledge31
Summary32
Chapter 2:Structures,Classes,and Instances33
Understanding structures,classes,and instances33
Understanding initialization and its customization34
Understanding deinitialization and its customization36
Understanding automatic reference counting36
Declaring classes37
Customizing initialization38
Customizing deinitialization41
Creating the instances of classes45
Exercises46
Test your knowledge46
Summary47
Chapter 3:Encapsulation of Data with Properties49
Understanding the elements that compose a class49
Declaring stored properties51
Generating computed properties with setters and getters54
Combining setters,getters,and a related property62
Understanding property observers65
Transforming values with setters and getters69
Using type properties to create values shared by all the instances of a class70
Creating mutable classes74
Building immutable classes78
Exercises81
Test your knowledge81
Summary82
Chapter 4:Inheritance,Abstraction,and Specialization83
Creating class hierarchies to abstract and specialize behavior83
Understanding inheritance88
Declaring classes that inherit from another class90
Overriding and overloading methods96
Overriding properties101
Controlling whether subclasses can or cannot override members103
Working with typecasting and polymorphism108
Taking advantage of operator overloading121
Declaring operator functions for specific subclasses126
Exercises128
Test your knowledge128
Summary129
Chapter 5:Contract Programming with Protocols131
Understanding how protocols work in combination with classes131
Declaring protocols133
Declaring classes that adopt protocols137
Taking advantage of the multiple inheritance of protocols142
Combining inheritance and protocols144
Working with methods that receive protocols as arguments152
Downcasting with protocols and classes155
Treating instances of a protocol type as a different subclass159
Specifying requirements for properties162
Specifying requirements for methods164
Combining class inheritance with protocol inheritance166
Exercises178
Test your knowledge179
Summary180
Chapter 6:Maximization of Code Reuse with Generic Code181
Understanding parametric polymorphism and generic code181
Declaring a protocol to be used as a constraint183
Declaring a class that conforms to multiple protocols184
Declaring subclasses that inherit the conformance to protocols188
Declaring a class that works with a constrained generic type190
Using a generic class for multiple types195
Combining initializer requirements in protocols with generic types201
Declaring associated types in protocols202
Creating shortcuts with subscripts204
Declaring a class that works with two constrained generic types206
Using a generic class with two generic type parameters209
Inheriting and adding associated types in protocols213
Generalizing existing classes with generics214
Extending base types to conform to custom protocols223
Test your knowledge225
Exercises226
Summary227
Chapter 7:Object-Oriented Programming and Functional Programming229
Refactoring code to take advantage of object-oriented programming229
Understanding functions as first-class citizens241
Working with function types within classes243
Creating a functional version of array filtering245
Writing equivalent closures with simplified code247
Creating a data repository with generics and protocols248
Filtering arrays with complex conditions253
Using map to transform values256
Combining map with reduce259
Chaining filter,map,and reduce262
Solving algorithms with reduce262
Exercises264
Test your knowledge265
Summary266
Chapter 8:Extending and Building Object-Oriented Code267
Putting together all the pieces of the object-oriented puzzle267
Adding methods with extensions269
Adding computed properties to a base type with extensions273
Declaring new convenience initializers with extensions278
Defining subscripts with extensions280
Working with object-oriented code in apps281
Adding an object-oriented data repository to a project290
Interacting with an object-oriented data repository through Picker View294
Exercises299
Test your knowledge299
Summary300
Appendix:Exercise Answers301
Chapter 1,Objects from the Real World to Playground301
Chapter 2,Structures,Classes,and Instances301
Chapter 3,Encapsulation of Data with Properties302
Chapter 4,Inheritance,Abstraction,and Specialization302
Chapter 5,Contract Programming with Protocols302
Chapter 6,Maximization of Code Reuse with Generic Code302
Chapter 7,Object-Oriented Programming and Functional Programming303
Chapter 8,Extending and Building Object-Oriented Code303
Index305