- Hands-On Design Patterns with Swift
- Florent Vilmart Giordano Scalzo Sergio De Simone
- 128字
- 2021-07-02 14:45:08
Swift basic types
Swift comes with a number of basic types that are at the root of all of your programs. All of your programs leverage these basic types, one way or another. Let's take some time to revisit these types and their main features, along with some hidden gems.
We can organize all of the Swift's basic types into the following categories:
- Logical types: Bool
- Numeric types: Int, Double, and Float, among others
- Range types: Range and ClosedRange
- Errors: Error protocol
- Optionals: Optional enum
I don't believe it's necessary to introduce the Bool, Int, Double, and Float types, as they are all very common in all languages. Perhaps their most interesting feature is that they are defined as structs, and not primitive types, like in Java.
推薦閱讀
- 我們都是數據控:用大數據改變商業、生活和思維方式
- LibGDX Game Development Essentials
- 大規模數據分析和建模:基于Spark與R
- 數據庫基礎與應用:Access 2010
- Java Data Science Cookbook
- 工業大數據分析算法實戰
- INSTANT Cytoscape Complex Network Analysis How-to
- LabVIEW 完全自學手冊
- HikariCP連接池實戰
- Python數據分析與數據化運營
- Chef Essentials
- Solaris操作系統原理實驗教程
- 貫通SQL Server 2008數據庫系統開發
- Gideros Mobile Game Development
- PostgreSQL高可用實戰