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

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.

主站蜘蛛池模板: 马山县| 中江县| 柘荣县| 灵丘县| 文昌市| 兴山县| 巴塘县| 洪江市| 城口县| 博白县| 咸丰县| 新昌县| 和田市| 淅川县| 敦化市| 五台县| 苏尼特右旗| 日照市| 沙洋县| 抚宁县| 唐河县| 措勤县| 抚州市| 时尚| 黎川县| 镇巴县| 林甸县| 岑溪市| 陕西省| 三江| 溧水县| 龙山县| 文山县| 屯昌县| 新化县| 资中县| 安宁市| 大英县| 乃东县| 尼玛县| 西安市|