- Swift Functional Programming(Second Edition)
- Dr. Fatih Nayebi
- 66字
- 2021-07-02 23:54:24
Tuples
Swift provides tuples so that they can be used to group multiple values/types into a single compound value. Consider the following example:
let http400Error = (400, "Bad Request")
// http400Error is of type (Int, String), and equals (400, "Bad Request")
// Decompose a Tuple's content
let (requestStatusCode, requestStatusMessage) = http400Error
Tuples can be used as return types in functions to implement multi-return functions as well.
推薦閱讀
- MySQL數據庫進階實戰
- 在你身邊為你設計Ⅲ:騰訊服務設計思維與實戰
- Developing Mobile Games with Moai SDK
- 信息系統與數據科學
- 數據庫系統原理及應用教程(第4版)
- 數據庫原理與應用(Oracle版)
- Flutter Projects
- 探索新型智庫發展之路:藍迪國際智庫報告·2015(下冊)
- Augmented Reality using Appcelerator Titanium Starter
- MySQL數據庫技術與應用
- 數據庫查詢優化器的藝術:原理解析與SQL性能優化
- AndEngine for Android Game Development Cookbook
- 大數據測試技術:數據采集、分析與測試實踐(在線實驗+在線自測)
- 數字化轉型實踐:構建云原生大數據平臺
- 工業大數據融合體系結構與關鍵技術