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

Summary

This was a very dense chapter. We have covered a lot of ground. We have delved deep into defining our own custom types using structures, classes, and enumerations. Structures are great for simple types, while classes are great for types that require a hierarchy of related types. Enumerations provide a way to group related things together and express more abstract concepts through associated values.

We have also created our first project, which made use of multiple source files improving the maintainability of our code bases, especially at scale. Extensions can be used across and within those files to add additional functionality to existing types, including those not defined by us.

Finally, we developed a good understanding of what scope is and how we can control it to our advantage, especially with the help of access controls to give us an even more fine grained filter on what code can interact with other code.

Now that you have made it this far, you are well on your way to becoming a quality Swift programmer. I definitely recommend that you take a breather and experiment with everything that you have learned so far. We have only a few more concepts left to learn until we have all the tools necessary for creating a great app.

Once you are ready to move on, we can talk about optionals, which I have already hinted at. Optionals are somewhat complex but are an integral part of using the Swift language effectively. In the next chapter, we will pe deep into what they are and then how to take advantage of them in the most effective ways possible.

主站蜘蛛池模板: 榆中县| 温宿县| 拜城县| 巴彦淖尔市| 岳普湖县| 上虞市| 湖北省| 龙州县| 墨竹工卡县| 宜兰县| 巨野县| 余庆县| 类乌齐县| 蒲江县| 沙坪坝区| 泾源县| 大竹县| 中西区| 陆丰市| 镇雄县| 十堰市| 布尔津县| 双柏县| 马鞍山市| 和顺县| 宜兰市| 雷波县| 利辛县| 河津市| 竹溪县| 岳普湖县| 丰城市| 观塘区| 横山县| 于都县| 普安县| 和龙市| 丹巴县| 乐都县| 上栗县| 宜章县|