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

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
主站蜘蛛池模板: 宝兴县| 清河县| 临西县| 万安县| 麦盖提县| 莲花县| 繁昌县| 苏尼特左旗| 遂川县| 綦江县| 枣强县| 柏乡县| 漳浦县| 台江县| 蓬安县| 凤山市| 德惠市| 南京市| 兴仁县| 徐水县| 锡林郭勒盟| 开远市| 马山县| 共和县| 七台河市| 灵山县| 油尖旺区| 松桃| 莆田市| 黔西县| 梁河县| 翁牛特旗| 内乡县| 凤阳县| 栖霞市| 磐石市| 华池县| 驻马店市| 张家港市| 福海县| 珠海市|