Swift Cheat Sheet by tschinz

This is a attempt to create a small easy-to-understand as well as easy-to-use cheat sheet for Swift. Swift is the new programming language of Apple used in all of their devices. It is:

  • Safe. The most obvious way to write code should also behave in a safe manner. Undefined behavior is the enemy of safety, and developer mistakes should be caught before software is in production. Opting for safety sometimes means Swift will feel strict, but we believe that clarity saves time in the long run.
  • Fast. Swift is intend as a replacement for C-based languages (C, C++, and Objective-C). As such, Swift must be comparable to those languages in performance for most tasks. Performance must also be predictable and consistent, not just fast in short bursts that require clean-up later. There are lots of languages with novel features — being fast is rare.
  • Expressive. Swift benefits from decades of advancement in computer science to offer syntax that is a joy to use, with modern features developers expect. But Swift is never done. We will monitor language advancements and embrace what works, continually evolving to make Swift even better.
Swift Icon
Figure: Swift Icon

License

Creative Commons License
Figure: Creative Commons License

Changelog

v0.0.1 - 28.01.2016

  • Initial release containing
    • Basics
    • Variables, Array, Dictionary
    • Data Structure and Methods
    • Control Flow
    • NS Classes