- Swift 4 Protocol-Oriented Programming(Third Edition)
- Jon Hoffman
- 116字
- 2021-07-08 09:42:37
Summary
While protocols themselves may not seem very exciting, they are actually quite powerful. As we saw in this chapter, we are able to use them to create very specific requirements. We can then use protocol inheritance and protocol composition to create protocol hierarchies. We also saw how to implement the delegation patterns with protocols.
We concluded the chapter by showing how we can model a robot with sensors using the protocol and how Apple uses protocols in the Swift standard library.
In Chapter 3, Extensions, we will see how we can use protocol extensions to add functionality to types that conform to a protocol but before we do that, let's look at our type choices.
推薦閱讀
- Oracle Exadata性能優(yōu)化
- JavaScript語言精髓與編程實踐(第3版)
- Java EE框架整合開發(fā)入門到實戰(zhàn):Spring+Spring MVC+MyBatis(微課版)
- 零基礎(chǔ)入門學(xué)習(xí)Python
- Java編程的邏輯
- C/C++程序員面試指南
- Python程序設(shè)計開發(fā)寶典
- 現(xiàn)代CPU性能分析與優(yōu)化
- SAP Web Dynpro for ABAP開發(fā)技術(shù)詳解:基礎(chǔ)應(yīng)用
- Spark技術(shù)內(nèi)幕:深入解析Spark內(nèi)核架構(gòu)設(shè)計與實現(xiàn)原理
- Getting Started with hapi.js
- Dart:Scalable Application Development
- 中小企業(yè)網(wǎng)站建設(shè)與管理(靜態(tài)篇)
- Learning ClojureScript
- 計算機網(wǎng)絡(luò)基礎(chǔ)