官术网_书友最值得收藏!

Types and Type Casting

In the previous chapter, we talked about functions and closures and covered topics such as function types. We know that functions are first-class citizens in Swift and they can be stored and passed around like any type. It is the time to look into types in detail.

This chapter starts with explaining types, touching on the concept of types in the category theory very briefly. Then it explains value and reference types and compares them in detail. Finally, it talks about equality, identity, and type casting.

This chapter will cover the following topics with coding examples:

  • Types
  • Different categories of types
  • Value versus reference types
    • Value and reference type constants
    • Mixing value and reference types
    • Copying
    • Value type characteristics
  • Equality, identity, and comparing
  • Type checking and casting
主站蜘蛛池模板: 英吉沙县| 利辛县| 池州市| 西林县| 木里| 如东县| 大洼县| 岳普湖县| 靖边县| 东乡县| 合作市| 都江堰市| 黑龙江省| 尼勒克县| 五原县| 台湾省| 新绛县| 南通市| 桐城市| 水城县| 芷江| 南投县| 渝中区| 西丰县| 奉化市| 洮南市| 西城区| 鸡西市| 宜都市| 错那县| 文山县| 广西| 花莲市| 吴江市| 察雅县| 陵水| 黑水县| 温泉县| 沙湾县| 平远县| 莎车县|