AnyCompiler

Free · No signup

Swift Tutorial

Learn Swift from the ground up. Every code example on every lesson is real and runnable — the output shown was captured from an actual execution on this site's own compiler, not typed by hand — and you can try each one yourself with one click.

  1. 1Introduction to Swift
  2. 2Your First Swift Program
  3. 3Variables and Types
  4. 4Operators and Control Flow
  5. 5Functions
  6. 6Optionals
  7. 7Arrays and Dictionaries
  8. 8Strings
  9. 9Structs and Classes
  10. 10Mutating Methods
  11. 11Properties
  12. 12Inheritance
  13. 13Protocols
  14. 14Enums
  15. 15Closures
  16. 16Extensions
  17. 17Generics
  18. 18Error Handling, and a Closing Look

More lessons are added regularly. Want to practice outside the tutorial? Open the Swift compiler. Prefer Kotlin? Read the Kotlin tutorial. Prefer Java? Read the Java tutorial. Prefer C#? Read the C# tutorial. Prefer C++? Read the C++ tutorial. Prefer C? Read the C tutorial. Prefer Rust? Read the Rust tutorial. Prefer Go? Read the Go tutorial. Prefer TypeScript? Read the TypeScript tutorial. Prefer JavaScript? Read the JavaScript tutorial. Prefer Python? Read the Python tutorial. Prefer Bash? Read the Bash tutorial. Prefer Perl? Read the Perl tutorial. Prefer Ruby? Read the Ruby tutorial. Prefer R? Read the R tutorial. Prefer PHP? Read the PHP tutorial. Prefer Hindi? Hindi mein padhein. Prefer Urdu? Roman Urdu mein parhein. ¿Prefieres español? Leer en español. Prefere português? Ler em português.