WHAT'S IN THIS APPENDIX?
WROX.COM CODE DOWNLOADS FOR THIS APPENDIX
This appendix covers the features and concepts introduced by the C programming language. While most Cocoa programs are written in the object-oriented style dictated by Swift (and Objective-C), C's procedural style of programming makes sense for some aspects of a program. Many system services on both OS X and iOS are also exposed only through C, and many third-party libraries and frameworks are written entirely in C, so a firm grasp of C is essential for any skilled Swift programmer.
COMPARING PROCEDURAL AND OBJECT-ORIENTED PROGRAMMING STYLES
Object-oriented programming languages are rooted in the concept of a class. An object, or instance of a class, contains data (instance variables) and defines behavior (methods) that acts on that data and interacts with other objects. This data and behavior are encapsulated in some way so that consumers of those objects can use them without knowing the details of their implementations. Classes also provide a template from which other classes may be created. Programs are modeled as a collection of objects ...