Summary
In this chapter, we covered topics ranging from variables and constants to data types and operators. The items in this chapter will act as the foundation for every application that you write; therefore, it is important to understand the concepts we discussed here.
In this chapter, we have seen that we should prefer constants to variables when the value is not going to change. Swift will give you a compile-time warning if you set but never change a variable's value. We also saw that we should prefer type inference over declaring a type.
Numeric and string types, which are implemented as primitives in other languages, are named types that are implemented with structures in Swift. In future chapters, you will see why this is important. One of the most important things to remember from this chapter is that, if a variable contains a nil value, you must declare it as an optional.
In the next chapter, we will look at Swift optional types. The optional type in Swift...