Bahasa

Referensi Cepat Swift

Cheat sheet siap cetak untuk Referensi Cepat Swift, disusun untuk pencarian cepat, belajar, dan referensi di meja

Sumber
Swift Documentation (swift.org)
Lisensi
MIT
Diperbarui
2026-03-27

Contoh

Isi cheat sheet ini

  • Dasar
  • Tipe Data
  • Alur Kontrol
  • Fungsi
  • Closure
  • Class & Struct
  • Protocol
  • Optional
  • Enum
  • Penanganan Error

Hello World

import Foundation
print("Hello, World!")

Konstanta & Variabel

let name = "Swift"       // constant (immutable)
var count = 0            // variable (mutable)
count += 1
let pi: Double = 3.14   // explicit type annotation

Komentar

// single-line comment
/* multi-line
   comment */
/// documentation comment (Markdown supported)

Unduh cheat sheet lengkap dengan semua bagian, siap cetak

Unduh PDF

Unduhan

Pilih varian yang sesuai dengan cara Anda membaca