- 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.
推薦閱讀
- 復(fù)雜性思考:復(fù)雜性科學(xué)和計算模型(原書第2版)
- Access 2007數(shù)據(jù)庫應(yīng)用上機(jī)指導(dǎo)與練習(xí)
- 工業(yè)大數(shù)據(jù)分析算法實(shí)戰(zhàn)
- SQL查詢:從入門到實(shí)踐(第4版)
- 揭秘云計算與大數(shù)據(jù)
- 數(shù)據(jù)庫應(yīng)用基礎(chǔ)教程(Visual FoxPro 9.0)
- iOS and OS X Network Programming Cookbook
- 大數(shù)據(jù)時代下的智能轉(zhuǎn)型進(jìn)程精選(套裝共10冊)
- 大數(shù)據(jù)治理與安全:從理論到開源實(shí)踐
- Power BI智能數(shù)據(jù)分析與可視化從入門到精通
- 代碼的未來
- GameMaker Game Programming with GML
- Applying Math with Python
- 數(shù)據(jù)庫高效優(yōu)化:架構(gòu)、規(guī)范與SQL技巧
- 反饋:化解不確定性的數(shù)字認(rèn)知論