- Mastering Swift
- Jon Hoffman
- 238字
- 2021-07-16 14:12:13
Chapter 3. Using Collections and Cocoa Data Types
Once I got past the basic Hello World beginner applications, I quickly began to realize the shortcomings of variables, especially with the Mad Libs (http://en.wikipedia.org/wiki/Mad_Libs) style applications that I was starting to write. These applications requested that the user enter in numerous strings and I was creating a separate variable for each input field that the user entered. Having all of these separate variables quickly became very cumbersome. I remember talking to a friend about this and he asked me why I was not using arrays. At the time, I was not familiar with arrays, so I asked him to show me what they were. Even though he had a TI-99/4A and I had a Commodore Vic-20, the concept of arrays was the same. Even today, the arrays found in modern development languages have the same basic concepts as the arrays I used on my Commodore Vic-20. While it is definitely possible to create a useful application without using collections, when used right, collections do make application development significantly easier.
In this chapter, we will cover the following topics:
- What is an array in Swift and how to use it?
- What is a dictionary in Swift and how to use it?
- What is a tuple in Swift and how to use it?
- How to use Cocoa data types in Swift?
- How to use Foundation data types in Swift?
- Web前端開發技術:HTML、CSS、JavaScript(第3版)
- FuelPHP Application Development Blueprints
- Android和PHP開發最佳實踐(第2版)
- NGINX Cookbook
- Learning Node.js for .NET Developers
- PHP 7從零基礎到項目實戰
- jQuery for Designers Beginner's Guide Second Edition
- Training Systems Using Python Statistical Modeling
- After Effects CC案例設計與經典插件(視頻教學版)
- jQuery Mobile Web Development Essentials(Second Edition)
- C語言編程魔法書:基于C11標準
- C# 7 and .NET Core 2.0 Blueprints
- Mastering R for Quantitative Finance
- Learning Redis
- Go語言編程之旅:一起用Go做項目