图书介绍

Swift 2 面向对象编程pdf电子书版本下载

Swift 2 面向对象编程
  • Gaston C.Hillar著 著
  • 出版社: 南京:东南大学出版社
  • ISBN:9787564170790
  • 出版时间:2017
  • 标注页数:309页
  • 文件大小:38MB
  • 文件页数:325页
  • 主题词:程序语言-程序设计-英文

PDF下载


点此进入-本书在线PDF格式电子书下载【推荐-云解压-方便快捷】直接下载PDF格式图书。移动端-PC端通用
种子下载[BT下载速度快] 温馨提示:(请使用BT下载软件FDM进行下载)软件下载地址页 直链下载[便捷但速度慢]   [在线试读本书]   [在线获取解压码]

下载说明

Swift 2 面向对象编程PDF格式电子书版下载

下载的文件为RAR压缩包。需要使用解压软件进行解压得到PDF格式图书。

建议使用BT下载工具Free Download Manager进行下载,简称FDM(免费,没有广告,支持多平台)。本站资源全部打包为BT种子。所以需要使用专业的BT下载软件进行下载。如 BitComet qBittorrent uTorrent等BT下载工具。迅雷目前由于本站不是热门资源。不推荐使用!后期资源热门了。安装了迅雷也可以迅雷进行下载!

(文件页数 要大于 标注页数,上中下等多册电子书除外)

注意:本站所有压缩包均有解压码: 点击下载压缩包解压工具

图书目录

Chapter 1:Objects from the Real World to Playground 1

Installing the required software 1

Capturing objects from the real world 4

Generating classes to create objects 11

Recognizing variables and constants to create properties 14

Recognizing actions to create methods 17

organizing classes with UML diagrams 20

Working with API objects in the Xcode Playground 26

Exercises 31

Test your knowledge 31

Summary 32

Chapter 2:Structures,Classes,and Instances 33

Understanding structures,classes,and instances 33

Understanding initialization and its customization 34

Understanding deinitialization and its customization 36

Understanding automatic reference counting 36

Declaring classes 37

Customizing initialization 38

Customizing deinitialization 41

Creating the instances of classes 45

Exercises 46

Test your knowledge 46

Summary 47

Chapter 3:Encapsulation of Data with Properties 49

Understanding the elements that compose a class 49

Declaring stored properties 51

Generating computed properties with setters and getters 54

Combining setters,getters,and a related property 62

Understanding property observers 65

Transforming values with setters and getters 69

Using type properties to create values shared by all the instances of a class 70

Creating mutable classes 74

Building immutable classes 78

Exercises 81

Test your knowledge 81

Summary 82

Chapter 4:Inheritance,Abstraction,and Specialization 83

Creating class hierarchies to abstract and specialize behavior 83

Understanding inheritance 88

Declaring classes that inherit from another class 90

Overriding and overloading methods 96

Overriding properties 101

Controlling whether subclasses can or cannot override members 103

Working with typecasting and polymorphism 108

Taking advantage of operator overloading 121

Declaring operator functions for specific subclasses 126

Exercises 128

Test your knowledge 128

Summary 129

Chapter 5:Contract Programming with Protocols 131

Understanding how protocols work in combination with classes 131

Declaring protocols 133

Declaring classes that adopt protocols 137

Taking advantage of the multiple inheritance of protocols 142

Combining inheritance and protocols 144

Working with methods that receive protocols as arguments 152

Downcasting with protocols and classes 155

Treating instances of a protocol type as a different subclass 159

Specifying requirements for properties 162

Specifying requirements for methods 164

Combining class inheritance with protocol inheritance 166

Exercises 178

Test your knowledge 179

Summary 180

Chapter 6:Maximization of Code Reuse with Generic Code 181

Understanding parametric polymorphism and generic code 181

Declaring a protocol to be used as a constraint 183

Declaring a class that conforms to multiple protocols 184

Declaring subclasses that inherit the conformance to protocols 188

Declaring a class that works with a constrained generic type 190

Using a generic class for multiple types 195

Combining initializer requirements in protocols with generic types 201

Declaring associated types in protocols 202

Creating shortcuts with subscripts 204

Declaring a class that works with two constrained generic types 206

Using a generic class with two generic type parameters 209

Inheriting and adding associated types in protocols 213

Generalizing existing classes with generics 214

Extending base types to conform to custom protocols 223

Test your knowledge 225

Exercises 226

Summary 227

Chapter 7:Object-Oriented Programming and Functional Programming 229

Refactoring code to take advantage of object-oriented programming 229

Understanding functions as first-class citizens 241

Working with function types within classes 243

Creating a functional version of array filtering 245

Writing equivalent closures with simplified code 247

Creating a data repository with generics and protocols 248

Filtering arrays with complex conditions 253

Using map to transform values 256

Combining map with reduce 259

Chaining filter,map,and reduce 262

Solving algorithms with reduce 262

Exercises 264

Test your knowledge 265

Summary 266

Chapter 8:Extending and Building Object-Oriented Code 267

Putting together all the pieces of the object-oriented puzzle 267

Adding methods with extensions 269

Adding computed properties to a base type with extensions 273

Declaring new convenience initializers with extensions 278

Defining subscripts with extensions 280

Working with object-oriented code in apps 281

Adding an object-oriented data repository to a project 290

Interacting with an object-oriented data repository through Picker View 294

Exercises 299

Test your knowledge 299

Summary 300

Appendix:Exercise Answers 301

Chapter 1,Objects from the Real World to Playground 301

Chapter 2,Structures,Classes,and Instances 301

Chapter 3,Encapsulation of Data with Properties 302

Chapter 4,Inheritance,Abstraction,and Specialization 302

Chapter 5,Contract Programming with Protocols 302

Chapter 6,Maximization of Code Reuse with Generic Code 302

Chapter 7,Object-Oriented Programming and Functional Programming 303

Chapter 8,Extending and Building Object-Oriented Code 303

Index 305

精品推荐