Skip to main content

Writing Swift Code

  • Chapter
  • First Online:
Beginning iPhone Development with Swift 5
  • 1948 Accesses

Abstract

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Wallace Wang

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Wang, W. (2019). Writing Swift Code. In: Beginning iPhone Development with Swift 5. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-4865-2_3

Download citation

Publish with us

Policies and ethics