[{"data":1,"prerenderedAt":215},["ShallowReactive",2],{"public-settings":3,"footer-custom-pages":18,"post-kotlin-multiplatform-compose-multiplatform-2026":31,"article-code-lc6a2s":214},{"site_title":4,"tagline":5,"site_url":6,"footer_text":5,"social_twitter":7,"social_github":7,"social_youtube":7,"social_linkedin":7,"social_mastodon":7,"og_image":8,"comments_enabled":9,"ads_mode":10,"ads_publisher_id":11,"ads_adtest":12,"ads_in_article_enabled":9,"ads_in_article_slot":13,"ads_in_article_paragraph":14,"ads_end_of_post_enabled":9,"ads_end_of_post_slot":13,"ads_feed_enabled":9,"ads_feed_slot":13,"ads_feed_every":15,"ads_sidebar_enabled":9,"ads_sidebar_slot":13,"ads_consent_enabled":9,"clarity_enabled":12,"clarity_project_id":16,"seo_enabled":9,"llms_enabled":9,"verification_google":7,"verification_bing":7,"seo_home_title":7,"seo_description":7,"indexnow_key":7,"performance_lcp_preload":9,"pwa_enabled":9,"bookmarks_enabled":9,"comments_moderation":9,"home_carousel_featured":9,"home_carousel_latest":9,"home_carousel_latest_mode":17,"home_carousel_series":9,"home_carousel_topics":9},"Android Learner","Practical Android development, explained clearly.","https:\u002F\u002Fwww.androidlearner.com","","\u002Fmedia\u002Fseed\u002Fcover-llm.webp","1","live","ca-pub-3394535770235553","0","9901451769","2","3","jmrmm96ef6","latest",[19,26],{"id":20,"title":21,"slug":22,"show_in_footer":23,"sort_order":24,"updated_at":25},1,"Terms & Conditions","terms",true,10,"2026-11-28 13:13:48",{"id":27,"title":28,"slug":29,"show_in_footer":23,"sort_order":30,"updated_at":25},2,"Privacy Policy","privacy",20,{"post":32,"comments":213},{"id":33,"title":34,"slug":35,"path":36,"excerpt":37,"cover_image":38,"cover_media_id":39,"status":40,"publish_at":41,"reading_time":27,"seo_title":42,"seo_description":43,"og_image":38,"canonical_url":44,"noindex":45,"featured":45,"faq":46,"howto":53,"review_note":53,"submitted_at":53,"reviewed_at":53,"category":54,"series":53,"tags":59,"author":78,"created_at":81,"updated_at":82,"body_md":83,"body_html":84,"related":85},26,"Kotlin Multiplatform (KMP) & Compose Multiplatform in 2026: Sharing Logic Without Regrets","kotlin-multiplatform-compose-multiplatform-2026","\u002Fposts\u002Fkotlin-multiplatform-compose-multiplatform-2026","A practical 2026 guide to structuring Kotlin Multiplatform modules, sharing Room\u002FKtor\u002FCoroutines across Android and iOS, and deciding when to use Compose Multiplatform.","\u002Fmedia\u002F2026\u002F11\u002Fc1c54b28d99ca23d.webp",68,"published","2026-11-28 15:43:00","Kotlin Multiplatform & Compose Multiplatform Guide (2026)","How to structure Kotlin Multiplatform (KMP) projects in 2026 with shared Room, Ktor, and Compose Multiplatform without sacrificing native platform quality.","https:\u002F\u002Fwww.androidlearner.com\u002Fposts\u002Fkotlin-multiplatform-compose-multiplatform-2026\u002F",false,[47,50],{"question":48,"answer":49},"Should we share UI with Compose Multiplatform or keep SwiftUI on iOS?","Share business logic, networking, and local storage first. Adopt Compose Multiplatform for UI when your team wants unified feature velocity and consistent design, or keep SwiftUI for iOS-specific system integrations.",{"question":51,"answer":52},"Does Room work on iOS in Kotlin Multiplatform?","Yes. Official Room KMP support lets you share @Entity, @Dao, and @Database definitions across Android, iOS, and Desktop using SQLite drivers.",null,{"id":55,"name":56,"slug":57,"description":58},3,"Kotlin","kotlin","Language, coroutines, and Flow.",[60,64,68,72,74],{"id":61,"name":62,"slug":63,"description":53},4,"Compose","compose",{"id":65,"name":66,"slug":67,"description":53},6,"Coroutines","coroutines",{"id":69,"name":70,"slug":71,"description":53},22,"Cross-Platform","cross-platform",{"id":73,"name":56,"slug":57,"description":53},52,{"id":75,"name":76,"slug":77,"description":53},8,"Room","room",{"id":20,"name":4,"username":79,"avatar":53,"profile_path":80},"superadmin","\u002Fu\u002Fsuperadmin","2026-11-28 10:11:54","2026-11-28 10:13:23","Kotlin Multiplatform (KMP) has matured from an experimental sharing layer into a mainstream production architecture. With official KMP support in **Room**, **DataStore**, **Ktor**, and **Compose Multiplatform**, teams can share as little or as much as makes sense for their product.\n\n## The Golden Rule: Share the Core First\n\nThe lowest-risk way to adopt KMP is sharing your **data and domain layers** while keeping platform-native entry points:\n\n- **Networking**: Ktor Client with `kotlinx.serialization`\n- **Local persistence**: Room KMP + DataStore\n- **Concurrency**: Kotlin Coroutines & `Flow`\n- **DI**: Koin or Metro \u002F kotlin-inject\n\n## Clean `commonMain` Repository Pattern\n\nKeep platform-specific engines (`OkHttp` on Android, `Darwin` on iOS) injected behind a shared `HttpClient` factory:\n\n```kotlin\n\u002F\u002F commonMain\nclass FeedRepository(\n    private val api: FeedApi,\n    private val dao: ArticleDao\n) {\n    fun observeFeed(): Flow\u003CList\u003CArticle>> = dao.observeAll()\n\n    suspend fun refreshFeed(): Result\u003CUnit> = runCatching {\n        val remote = api.fetchLatest()\n        dao.upsertAll(remote.map { it.toEntity() })\n    }\n}\n```\n\n## Exposing `Flow` Cleanly to Swift\n\nWhile Kotlin `Flow` works directly in Android Compose via `collectAsStateWithLifecycle()`, iOS Swift callers benefit from **SKIE** (Swift Kotlin Interface Enhancer) or a thin wrapper that turns `Flow\u003CT>` into `AsyncSequence`:\n\n```swift\n\u002F\u002F iOS SwiftUI ViewModel\nfor await articles in repository.observeFeed() {\n    self.articles = articles\n}\n```\n\n## When to Add Compose Multiplatform for UI\n\nConsider sharing UI with **Compose Multiplatform** when:\n1. Your app has custom brand design rather than strict iOS Cupertino chrome.\n2. A single mobile team ships features simultaneously to Android and iOS.\n3. You want shared UI previews, theming, and navigation logic.\n\nIf your app relies heavily on Apple-specific frameworks (ARKit, complex Share Extensions, or native MapKit sheets), keep SwiftUI at the outer shell and embed shared Compose Multiplatform screens only where they shine.\n","\u003Cp>Kotlin Multiplatform (KMP) has matured from an experimental sharing layer into a mainstream production architecture. With official KMP support in \u003Cstrong>Room\u003C\u002Fstrong>, \u003Cstrong>DataStore\u003C\u002Fstrong>, \u003Cstrong>Ktor\u003C\u002Fstrong>, and \u003Cstrong>Compose Multiplatform\u003C\u002Fstrong>, teams can share as little or as much as makes sense for their product.\u003C\u002Fp>\n\u003Ch2 id=\"the-golden-rule-share-the-core-first\">The Golden Rule: Share the Core First\u003C\u002Fh2>\n\u003Cp>The lowest-risk way to adopt KMP is sharing your \u003Cstrong>data and domain layers\u003C\u002Fstrong> while keeping platform-native entry points:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>Networking\u003C\u002Fstrong>: Ktor Client with \u003Ccode>kotlinx.serialization\u003C\u002Fcode>\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Local persistence\u003C\u002Fstrong>: Room KMP + DataStore\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Concurrency\u003C\u002Fstrong>: Kotlin Coroutines &amp; \u003Ccode>Flow\u003C\u002Fcode>\u003C\u002Fli>\n\u003Cli>\u003Cstrong>DI\u003C\u002Fstrong>: Koin or Metro \u002F kotlin-inject\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"clean-commonmain-repository-pattern\">Clean \u003Ccode>commonMain\u003C\u002Fcode> Repository Pattern\u003C\u002Fh2>\n\u003Cp>Keep platform-specific engines (\u003Ccode>OkHttp\u003C\u002Fcode> on Android, \u003Ccode>Darwin\u003C\u002Fcode> on iOS) injected behind a shared \u003Ccode>HttpClient\u003C\u002Fcode> factory:\u003C\u002Fp>\n\u003Cpre class=\"code-block\" data-lang=\"kotlin\">\u003Ccode class=\"language-kotlin\">\u002F\u002F commonMain\nclass FeedRepository(\n    private val api: FeedApi,\n    private val dao: ArticleDao\n) {\n    fun observeFeed(): Flow&lt;List&lt;Article&gt;&gt; = dao.observeAll()\n\n    suspend fun refreshFeed(): Result&lt;Unit&gt; = runCatching {\n        val remote = api.fetchLatest()\n        dao.upsertAll(remote.map { it.toEntity() })\n    }\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2 id=\"exposing-flow-cleanly-to-swift\">Exposing \u003Ccode>Flow\u003C\u002Fcode> Cleanly to Swift\u003C\u002Fh2>\n\u003Cp>While Kotlin \u003Ccode>Flow\u003C\u002Fcode> works directly in Android Compose via \u003Ccode>collectAsStateWithLifecycle()\u003C\u002Fcode>, iOS Swift callers benefit from \u003Cstrong>SKIE\u003C\u002Fstrong> (Swift Kotlin Interface Enhancer) or a thin wrapper that turns \u003Ccode>Flow&lt;T&gt;\u003C\u002Fcode> into \u003Ccode>AsyncSequence\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cpre class=\"code-block\" data-lang=\"swift\">\u003Ccode class=\"language-swift\">\u002F\u002F iOS SwiftUI ViewModel\nfor await articles in repository.observeFeed() {\n    self.articles = articles\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2 id=\"when-to-add-compose-multiplatform-for-ui\">When to Add Compose Multiplatform for UI\u003C\u002Fh2>\n\u003Cp>Consider sharing UI with \u003Cstrong>Compose Multiplatform\u003C\u002Fstrong> when:\u003C\u002Fp>\n\u003Col>\n\u003Cli>Your app has custom brand design rather than strict iOS Cupertino chrome.\u003C\u002Fli>\n\u003Cli>A single mobile team ships features simultaneously to Android and iOS.\u003C\u002Fli>\n\u003Cli>You want shared UI previews, theming, and navigation logic.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>If your app relies heavily on Apple-specific frameworks (ARKit, complex Share Extensions, or native MapKit sheets), keep SwiftUI at the outer shell and embed shared Compose Multiplatform screens only where they shine.\u003C\u002Fp>\n",[86,127,157,193],{"id":87,"title":88,"slug":89,"path":90,"excerpt":91,"cover_image":92,"cover_media_id":93,"status":40,"publish_at":94,"reading_time":27,"seo_title":95,"seo_description":96,"og_image":92,"canonical_url":97,"noindex":45,"featured":45,"faq":98,"howto":53,"review_note":53,"submitted_at":53,"reviewed_at":53,"category":105,"series":53,"tags":109,"author":125,"created_at":126,"updated_at":94},24,"Google's \"Compose First\" Era: Migrating Legacy XML & RecyclerView Screens","compose-first-migrating-legacy-xml-recyclerview","\u002Fposts\u002Fcompose-first-migrating-legacy-xml-recyclerview","With android.widget Views, Fragments, and XML layout editors officially in maintenance mode, here is a practical, incremental playbook for migrating to Jetpack Compose.","\u002Fmedia\u002F2026\u002F11\u002F5f47e539df8d96b9.webp",66,"2026-11-28 10:14:54","Compose First Migration Guide: XML & RecyclerView to Compose","Step-by-step guide to migrating legacy Android XML layouts, Fragments, and RecyclerView adapters to Jetpack Compose without rewriting your entire app at once.","https:\u002F\u002Fwww.androidlearner.com\u002Fposts\u002Fcompose-first-migrating-legacy-xml-recyclerview\u002F",[99,102],{"question":100,"answer":101},"Do I have to rewrite my entire app to adopt Compose First?","No. You can embed Compose inside existing XML layouts with ComposeView, replace RecyclerView item types incrementally, and migrate Fragment navigation screen by screen.",{"question":103,"answer":104},"Are XML Views being removed from Android?","No, existing View APIs remain in the Android SDK for compatibility, but they are in maintenance mode—meaning critical bug fixes only, while all new UI capabilities ship in Jetpack Compose.",{"id":27,"name":106,"slug":107,"description":108},"Jetpack Compose","jetpack-compose","Modern Android UI.",[110,114,118,119,121],{"id":111,"name":112,"slug":113,"description":53},28,"Android","android",{"id":115,"name":116,"slug":117,"description":53},48,"Architecture","architecture",{"id":61,"name":62,"slug":63,"description":53},{"id":120,"name":106,"slug":107,"description":53},18,{"id":122,"name":123,"slug":124,"description":53},31,"Recycler View","recycler-view",{"id":20,"name":4,"username":79,"avatar":53,"profile_path":80},"2026-11-28 10:11:53",{"id":30,"title":128,"slug":129,"path":130,"excerpt":131,"cover_image":132,"cover_media_id":133,"status":40,"publish_at":134,"reading_time":75,"seo_title":135,"seo_description":136,"og_image":132,"canonical_url":137,"noindex":45,"featured":45,"faq":138,"howto":53,"review_note":53,"submitted_at":53,"reviewed_at":53,"category":145,"series":53,"tags":146,"author":154,"created_at":155,"updated_at":156},"Material 2 Is Deprecated: Move to Material 3 1.5 and TextFieldState","migrate-compose-material-2-to-material-3-1-5","\u002Fposts\u002Fmigrate-compose-material-2-to-material-3-1-5","Material 3 1.5.0 is stable and Material 2 is no longer actively maintained. This guide covers the theme swap, component move, and TextFieldState migration.","\u002Fmedia\u002F2026\u002F11\u002Faf355ed5e362f80d.webp",57,"2026-11-25 01:00:00","Migrate from Compose Material 2 to Material 3 1.5","Compose Material 2 is no longer maintained. Adopt Material 3 1.5.0 and replace deprecated value-based TextField APIs with TextFieldState.","https:\u002F\u002Fwww.androidlearner.com\u002Fposts\u002Fmigrate-compose-material-2-to-material-3-1-5\u002F",[139,142],{"question":140,"answer":141},"Is Material 2 removed from the Compose BOM?","No. It is deprecated and no longer actively maintained, but existing Material 2 screens still compile. Plan the migration if you want ongoing bug fixes and the current design language.",{"question":143,"answer":144},"Are Material 3 value-based TextField overloads deprecated in 1.5.0?","No. Android Developers say those Material 3 overloads are not deprecated yet in 1.5.0, but they already recommend the state-based TextField and OutlinedTextField APIs. Value-based BasicTextField and Material 2 TextField are deprecated in Compose 1.13.",{"id":27,"name":106,"slug":107,"description":108},[147,148,149,150],{"id":111,"name":112,"slug":113,"description":53},{"id":61,"name":62,"slug":63,"description":53},{"id":120,"name":106,"slug":107,"description":53},{"id":151,"name":152,"slug":153,"description":53},46,"Material 3","material-3",{"id":20,"name":4,"username":79,"avatar":53,"profile_path":80},"2026-11-24 19:51:49","2026-11-24 19:53:11",{"id":158,"title":159,"slug":160,"path":161,"excerpt":162,"cover_image":163,"cover_media_id":164,"status":40,"publish_at":165,"reading_time":166,"seo_title":167,"seo_description":168,"og_image":163,"canonical_url":169,"noindex":45,"featured":45,"faq":170,"howto":53,"review_note":53,"submitted_at":53,"reviewed_at":53,"category":177,"series":53,"tags":178,"author":190,"created_at":191,"updated_at":192},19,"What's New in Jetpack Compose 1.13 (November 2026)","jetpack-compose-1-13-flexbox-grid-progressive-blur","\u002Fposts\u002Fjetpack-compose-1-13-flexbox-grid-progressive-blur","Compose 1.13 is stable in BOM 2026.11.01. Here is how to upgrade, when to use FlexBox and Grid, and what progressive blur and the new deprecations actually mean.","\u002Fmedia\u002F2026\u002F11\u002F6fab1724acc6e8e3.webp",54,"2026-11-25 00:30:00",7,"Jetpack Compose 1.13: FlexBox, Grid, and Progressive Blur","Upgrade to Compose BOM 2026.11.01. Stable FlexBox and Grid, progressive blur, PolygonShape, and the Kotlin 2.2 \u002F compileSdk 37.1 requirements.","https:\u002F\u002Fwww.androidlearner.com\u002Fposts\u002Fjetpack-compose-1-13-flexbox-grid-progressive-blur\u002F",[171,174],{"question":172,"answer":173},"Do I need Kotlin 2.2 to use Compose 1.13?","Yes. The official 18 November 2026 Compose release post requires Kotlin 2.2 or newer and compileSdk 37.1 when you upgrade to Compose BOM 2026.11.01.",{"question":175,"answer":176},"Should I replace FlowRow and FlowColumn immediately?","Not necessarily. Android Developers say FlexBox supersedes the Flow layouts and recommend FlexBox for new code. Existing Flow call sites still compile; move them when you next touch those screens.",{"id":27,"name":106,"slug":107,"description":108},[179,180,181,185,189],{"id":111,"name":112,"slug":113,"description":53},{"id":61,"name":62,"slug":63,"description":53},{"id":182,"name":183,"slug":184,"description":53},44,"FlexBox","flexbox",{"id":186,"name":187,"slug":188,"description":53},45,"Grid","grid",{"id":120,"name":106,"slug":107,"description":53},{"id":20,"name":4,"username":79,"avatar":53,"profile_path":80},"2026-11-24 19:51:47","2026-11-24 19:53:09",{"id":27,"title":194,"slug":195,"path":196,"excerpt":197,"cover_image":198,"cover_media_id":65,"status":40,"publish_at":199,"reading_time":55,"seo_title":200,"seo_description":197,"og_image":198,"canonical_url":201,"noindex":45,"featured":45,"faq":202,"howto":53,"review_note":53,"submitted_at":53,"reviewed_at":53,"category":203,"series":53,"tags":204,"author":210,"created_at":211,"updated_at":212},"Jetpack Compose state hoisting","jetpack-compose-state-hoisting","\u002Fposts\u002Fjetpack-compose-state-hoisting","Keep Compose screens testable and recomposition cheap: state goes down, events go up, and the ViewModel stays the source of truth.","\u002Fmedia\u002Fseed\u002Fcover-compose.webp","2026-11-17 03:14:13","Jetpack Compose state hoisting, explained with code","https:\u002F\u002Fwww.androidlearner.com\u002Fposts\u002Fjetpack-compose-state-hoisting\u002F",[],{"id":27,"name":106,"slug":107,"description":108},[205,206],{"id":61,"name":62,"slug":63,"description":53},{"id":207,"name":208,"slug":209,"description":53},5,"State hoisting","state-hoisting",{"id":20,"name":4,"username":79,"avatar":53,"profile_path":80},"2026-11-20 05:18:17","2026-11-22 03:14:13",[],"\u003Cp>Kotlin Multiplatform (KMP) has matured from an experimental sharing layer into a mainstream production architecture. With official KMP support in \u003Cstrong>Room\u003C\u002Fstrong>, \u003Cstrong>DataStore\u003C\u002Fstrong>, \u003Cstrong>Ktor\u003C\u002Fstrong>, and \u003Cstrong>Compose Multiplatform\u003C\u002Fstrong>, teams can share as little or as much as makes sense for their product.\u003C\u002Fp>\n\u003Ch2 id=\"the-golden-rule-share-the-core-first\">The Golden Rule: Share the Core First\u003C\u002Fh2>\n\u003Cp>The lowest-risk way to adopt KMP is sharing your \u003Cstrong>data and domain layers\u003C\u002Fstrong> while keeping platform-native entry points:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>Networking\u003C\u002Fstrong>: Ktor Client with \u003Ccode>kotlinx.serialization\u003C\u002Fcode>\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Local persistence\u003C\u002Fstrong>: Room KMP + DataStore\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Concurrency\u003C\u002Fstrong>: Kotlin Coroutines &amp; \u003Ccode>Flow\u003C\u002Fcode>\u003C\u002Fli>\n\u003Cli>\u003Cstrong>DI\u003C\u002Fstrong>: Koin or Metro \u002F kotlin-inject\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"clean-commonmain-repository-pattern\">Clean \u003Ccode>commonMain\u003C\u002Fcode> Repository Pattern\u003C\u002Fh2>\n\u003Cp>Keep platform-specific engines (\u003Ccode>OkHttp\u003C\u002Fcode> on Android, \u003Ccode>Darwin\u003C\u002Fcode> on iOS) injected behind a shared \u003Ccode>HttpClient\u003C\u002Fcode> factory:\u003C\u002Fp>\n\u003Cdiv class=\"code-block\" data-lang=\"kotlin\">\u003Cdiv class=\"code-block__header\">\u003Cspan class=\"code-block__lang\">kotlin\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"code-block__copy\" aria-label=\"Copy code\">Copy\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cdiv class=\"code-block__body\">\u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"color:#6A737D\">\u002F\u002F commonMain\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">class\u003C\u002Fspan>\u003Cspan style=\"color:#B392F0\"> FeedRepository\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">(\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">    private\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\"> val\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> api: \u003C\u002Fspan>\u003Cspan style=\"color:#B392F0\">FeedApi\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">    private\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\"> val\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> dao: \u003C\u002Fspan>\u003Cspan style=\"color:#B392F0\">ArticleDao\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">) {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">    fun\u003C\u002Fspan>\u003Cspan style=\"color:#B392F0\"> observeFeed\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">(): \u003C\u002Fspan>\u003Cspan style=\"color:#B392F0\">Flow\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">&#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#B392F0\">List\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">&#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#B392F0\">Article\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">>> \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> dao.\u003C\u002Fspan>\u003Cspan style=\"color:#B392F0\">observeAll\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">()\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">    suspend\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\"> fun\u003C\u002Fspan>\u003Cspan style=\"color:#B392F0\"> refreshFeed\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">(): \u003C\u002Fspan>\u003Cspan style=\"color:#B392F0\">Result\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">&#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#B392F0\">Unit\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">> \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#B392F0\"> runCatching\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">        val\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> remote \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> api.\u003C\u002Fspan>\u003Cspan style=\"color:#B392F0\">fetchLatest\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">()\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">        dao.\u003C\u002Fspan>\u003Cspan style=\"color:#B392F0\">upsertAll\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">(remote.\u003C\u002Fspan>\u003Cspan style=\"color:#B392F0\">map\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> { it.\u003C\u002Fspan>\u003Cspan style=\"color:#B392F0\">toEntity\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">() })\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">    }\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Fdiv>\n\u003Ch2 id=\"exposing-flow-cleanly-to-swift\">Exposing \u003Ccode>Flow\u003C\u002Fcode> Cleanly to Swift\u003C\u002Fh2>\n\u003Cp>While Kotlin \u003Ccode>Flow\u003C\u002Fcode> works directly in Android Compose via \u003Ccode>collectAsStateWithLifecycle()\u003C\u002Fcode>, iOS Swift callers benefit from \u003Cstrong>SKIE\u003C\u002Fstrong> (Swift Kotlin Interface Enhancer) or a thin wrapper that turns \u003Ccode>Flow&lt;T&gt;\u003C\u002Fcode> into \u003Ccode>AsyncSequence\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cdiv class=\"code-block\" data-lang=\"swift\">\u003Cdiv class=\"code-block__header\">\u003Cspan class=\"code-block__lang\">swift\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"code-block__copy\" aria-label=\"Copy code\">Copy\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cdiv class=\"code-block__body\">\u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"color:#6A737D\">\u002F\u002F iOS SwiftUI ViewModel\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">for\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\"> await\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> articles \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">in\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> repository.\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">observeFeed\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">() {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#79B8FF\">    self\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">.articles \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> articles\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Fdiv>\n\u003Ch2 id=\"when-to-add-compose-multiplatform-for-ui\">When to Add Compose Multiplatform for UI\u003C\u002Fh2>\n\u003Cp>Consider sharing UI with \u003Cstrong>Compose Multiplatform\u003C\u002Fstrong> when:\u003C\u002Fp>\n\u003Col>\n\u003Cli>Your app has custom brand design rather than strict iOS Cupertino chrome.\u003C\u002Fli>\n\u003Cli>A single mobile team ships features simultaneously to Android and iOS.\u003C\u002Fli>\n\u003Cli>You want shared UI previews, theming, and navigation logic.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>If your app relies heavily on Apple-specific frameworks (ARKit, complex Share Extensions, or native MapKit sheets), keep SwiftUI at the outer shell and embed shared Compose Multiplatform screens only where they shine.\u003C\u002Fp>\n",1795877411956]