wandres.dev
iOS cheatsheet
⌘ REFERENCIA · 49 elementos

Cheatsheet de iOS

El desarrollo de apps Apple en un sitio: SwiftUI, estado, datos, sistema y distribución. Busca por API o por lo que quieres hacer.

📐 Vistas y layout 6

Contenedores básicosVStack · HStack · ZStack
Proponer o fijar tamaño.frame(width:height:alignment:)
Modificadores comunes.padding() · .background() · .overlay()
Prioridad al repartir espacio.layoutPriority(1)
Leer el tamaño propuestoGeometryReader
Contenedor propioLayout protocol

🔄 Estado 6

Estado propio de la vista@State
Referencia al estado del padre@Binding
Modelo observable (Observation)@Observable class
Bindings a un @Observable@Bindable
Valores del entorno@Environment(\.dismiss)
Forzar nueva identidad de vista.id(valor)

🧭 Listas y navegación 7

Listas y repeticiónList { } · ForEach(items) { }
Identidad de cada filaIdentifiable / id: \.self
Pila de navegación como estadoNavigationStack(path:)
Destino por tipo.navigationDestination(for:)
Presentar modal.sheet(isPresented:)
Dos o tres columnas (iPad/Mac)NavigationSplitView
Acciones al deslizar.swipeActions { }

🗄️ Datos 6

SwiftData: entidad persistida@Model class
Consulta reactiva@Query var items: [T]
Insertar y guardarmodelContext.insert(x)
Relaciones entre modelos@Relationship(deleteRule:)
Preferencias simplesUserDefaults · @AppStorage
Secretos y credencialesKeychain

🌐 Async y red 6

Trabajo ligado a la vida de la vista.task { await … }
Pull to refresh.refreshable { await … }
Petición con async/awaitURLSession.shared.data(from:)
Decodificar respuestaJSONDecoder().decode(T.self, from:)
Ejecutar en el hilo principal@MainActor
Imagen remotaAsyncImage(url:)

✨ Animaciones 5

Animar un cambio de estadowithAnimation { estado = x }
Animar según un valor.animation(.spring, value: x)
Entrada y salida.transition(.slide)
Efecto héroe entre vistasmatchedGeometryEffect(id:in:)
Secuencias complejasPhaseAnimator · KeyframeAnimator

🧩 Sistema 6

WidgetsWidgetKit · TimelineProvider
Siri, Atajos y SpotlightApp Intents
Notificaciones locales y pushUNUserNotificationCenter
Compras y suscripcionesStoreKit 2: Product · Transaction
Sincronizar entre dispositivosCloudKit + SwiftData
Métricas de rendimiento del sistemaMetricKit

🚢 Calidad y envío 7

Etiqueta para VoiceOver.accessibilityLabel("…")
Localización modernaString Catalog
Swift Testing@Test · #expect
Tests de interfazXCUITest
Perfilar la appInstruments: Time Profiler
DistribuciónTestFlight → App Store
Envolver una vista de UIKitUIViewRepresentable