Skip to content

Latest commit

 

History

History

SwiftDemo

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Swift Demo

Purpose

This project contains ideas, notes and other useful information related to the Swift language itself and how it works.

Useful information

  • Swift uses Unicode-correct Strings with UTF-8 encoding > good for internationalization
  • Inferred types
  • Memory - reference counting
  • Generics
  • Protocol extensions
  • First class functions > Use functions and methods inside other functions or methods; pass functions as arguments, save them in properties; pass initializers as arguments
  • Functional programming patterns - map, filter
  • Swift uses value types for commonly used types, like Arrays or Dictionaries
  • Optionals - binding, chaining, nil coalescing
  • LLVM Compiler
  • Source and binary compatibility
  • Swift for Server
  • Swift Package Manager - build, run, test and package Swift libraries and executables; easy to distribute the code
  • Array vs Set vs Dictionary
  • Tuples - groups of values
  • Swift is type-safe: if you need an Int, you can't pass a String by mistake; Swift does not let you pass an Optional String when you actually need a String (ie non-optional String)

Useful links