Decida qué permanece nativo
Establezca límites prácticos entre la interfaz compartida y la de cada plataforma.
Decida qué permanece nativo es una lección gratuita de Kotlin Multiplatform Academy en CoddyKit. Esta es la lección 4 de 4. Puedes leer la lección completa abajo gratuitamente — luego la practicas en el navegador con un editor de código integrado y un tutor de IA 24/7. Forma parte de la ruta de aprendizaje de Kotlin Multiplatform Academy, y tu progreso se sincroniza en la web y la app de CoddyKit. El curso de Kotlin Multiplatform Academy incluye 4 lecciones en total.
Partes de esta lección aún no han sido traducidas y se muestran en inglés.
Share Smart, Not Everything
KMP rewards sharing logic, but not every line should move. The real skill is deciding what goes shared and what stays comfortably native.
Logic Loves Shared
Calculations, validation, networking and parsing belong in shared code. They behave identically everywhere, so writing them twice only invites drift.
UI Can Stay Native
A polished, platform-true interface is often worth writing twice. Jetpack Compose and SwiftUI let each app feel native while sharing the brains beneath.
Presentation Is a Choice
ViewModels and state can be shared, yet many teams keep presentation native for flexibility. It is a deliberate trade, not a rule carved in stone.
Lean on the Platform
Cameras, sensors, biometrics and deep OS features are easiest in native code. Wrap them behind expect/actual when shared code must reach them.
Watch the Bridge Cost
Crossing the Kotlin-to-Swift bridge has friction. If exposing something shared makes the Swift side ugly, leaving it native can be the kinder call.
Follow the Stability
Mature pieces, like core logic, are safe to share. For areas still evolving, such as cutting-edge UI, staying native avoids fighting young tooling.
Team Skills Matter
If your iOS team loves SwiftUI, forcing shared UI may slow them. Honest team preferences are a legitimate input to the share-or-not decision.
A Simple Heuristic
Ask one question: would this behave the same on every platform? If yes, share it. If it is about feel, hardware or look, lean native.
You Can Move the Line
The boundary is not permanent. Start native, then promote stable code into commonMain later. KMP lets the share line shift as confidence grows.
Pragmatism Wins
There is no purity prize for sharing one hundred percent. The best KMP apps share what truly benefits and stay pragmatic about the rest. 🙂
Quick Check
Which kind of code is the strongest candidate to keep native?
Recap
You learned to share logic, models and networking while keeping UI and hardware native, using a simple heuristic and shifting the line as confidence grows. 🎉
Preguntas frecuentes
¿La lección «Decida qué permanece nativo» es gratis?
Sí — el texto completo de «Decida qué permanece nativo» es gratis para leer aquí en la web. Para practicarla de forma interactiva (editor de código integrado y tutor de IA 24/7) y desbloquear el resto del curso de Kotlin Multiplatform Academy, actualiza a CoddyKit PRO. El curso de Kotlin Multiplatform Academy incluye 4 lecciones en total.
¿Qué aprenderé en «Decida qué permanece nativo»?
Establezca límites prácticos entre la interfaz compartida y la de cada plataforma. Practicas Kotlin Multiplatform Academy con código real que ejecutas directamente en el navegador, y un tutor de IA 24/7 responde tus preguntas mientras trabajas en la lección.
¿Necesito experiencia previa para empezar Kotlin Multiplatform Academy?
No se requiere experiencia previa. Kotlin Multiplatform Academy en CoddyKit está estructurado para principiantes hasta estudiantes avanzados, así que puedes empezar aquí o desde el inicio y avanzar a tu ritmo. Esta es la lección 4 de 4.
¿Cuánto tiempo toma la lección «Decida qué permanece nativo»?
La mayoría de las lecciones de CoddyKit toman alrededor de 5–10 minutos. Cada una es compacta e interactiva, así que avanzas constantemente y retomas exactamente por donde dejaste en la web y la app.
¿Puedo escribir y ejecutar código en esta lección de Kotlin Multiplatform Academy?
Sí. Cada lección de Kotlin Multiplatform Academy incluye un editor de código integrado, así que escribes y ejecutas código real directamente en tu navegador y obtienes retroalimentación instantánea de IA — sin configuración local necesaria.
Todas las lecciones de este curso
- Arquitectura por capas para KMP
- Casos de uso y límites del dominio
- Divida el código compartido en módulos
- Decida qué permanece nativo