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

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.

主站蜘蛛池模板: 黄平县| 同德县| 绥芬河市| 锡林郭勒盟| 柏乡县| 天峨县| 达拉特旗| 弥渡县| 宿迁市| 沅江市| 米脂县| 安多县| 余姚市| 阜宁县| 抚顺县| 丽水市| 临洮县| 辽宁省| 萝北县| 文山县| 凤山县| 阿巴嘎旗| 秀山| 江陵县| 台中县| 泉州市| 乌拉特后旗| 翁牛特旗| 青海省| 临沂市| 尚义县| 普兰店市| 酒泉市| 棋牌| 霍邱县| 睢宁县| 浦江县| 通化市| 柏乡县| 和平县| 池州市|