This chapter will focus on performing operations, including arithmetic, logical, bitwise, type checking, and type casting. Operator precedence and associativity rules will also be reviewed.
Swift includes the same basic operators as Objective-C, yet it adheres to a slightly different set of rules for operator precedence and associativity that are intended to be simpler and more predictable. Precedence and associativity will be covered later in this chapter.
The basic operators are implemented in Swift in the same manner as Objective-C, with a few exceptions and additions that will be mentioned next, followed by a summary of all basic operators with examples in Tables 4-1 through 4-4.
In both ...