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

  • Learning Swift
  • Andrew J Wagner
  • 165字
  • 2021-07-16 13:54:09

Chapter 3. One Piece at a Time – Types, Scopes, and Projects

In Chapter 2, Building Blocks – Variables, Collections, and Flow Control, we developed a very simple program that helped us organize a party. Even though we separated parts of the code in a logical way, everything was written in a single file and our functions were all lumped together. As projects grow in complexity, this way of organizing code is not sustainable. Just as we use functions to separate out logical components of our code, at scale, we also need to be able to separate out logical components of our functions and data. To do this, we can define code in different files and we can also create our own types that contain custom data and functionality. These types are commonly referred to as objects, as a part of the programming technique called object-oriented programming. In this chapter, we will cover:

  • Structs
  • Classes and inheritance
  • Enumerations
  • Projects
  • Extensions
  • Scope
  • Access control
主站蜘蛛池模板: 西乌珠穆沁旗| 板桥市| 滦南县| 营口市| 历史| 聂荣县| 余姚市| 阜康市| 祁门县| 澳门| 德州市| 天台县| 麟游县| 武穴市| 荃湾区| 通许县| 花莲市| 甘南县| 福建省| 菏泽市| 临沧市| 甘洛县| 东乌| 永登县| 库尔勒市| 万安县| 荥经县| 策勒县| 图木舒克市| 台北市| 达孜县| 大关县| 靖西县| 鹿邑县| 嘉祥县| 鹤山市| 托克托县| 涟水县| 伊宁县| 新郑市| 哈巴河县|