© Wallace Wang 2019
Wallace WangBeginning iPhone Development with Swift 5https://doi.org/10.1007/978-1-4842-4865-2_3

3. Writing Swift Code

Wallace Wang1 
(1)
San Diego, CA, USA
 

Every iOS app needs a user interface, but that user interface won’t do anything until you write Swift code to make it work. While you could write all your code in a single file, it’s better to divide your code into files where each file contains related code. A simple app might only contain a handful of files, but a more complicated app could contain dozens or even hundreds of separate files that contain related Swift code. Within each file, you can further organize your Swift code into separate functions.

Swift code is necessary to
  • Retrieve data from the user interface

  • Calculate ...

Get Beginning iPhone Development with Swift 5: Exploring the iOS SDK now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.