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

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
主站蜘蛛池模板: 吴忠市| 辉南县| 宜宾县| 赤壁市| 北宁市| 天峨县| 民和| 上犹县| 景洪市| 科技| 五寨县| 余干县| 北流市| 南宁市| 雷波县| 龙门县| 太仆寺旗| 陆良县| 措美县| 会泽县| 会昌县| 镇宁| 石泉县| 南阳市| 乌审旗| 黄龙县| 内黄县| 麻阳| 新乡县| 巴马| 岳阳市| 巫山县| 运城市| 麻栗坡县| 海城市| 英德市| 泽库县| 张家口市| 云霄县| 巩义市| 会东县|