

JetBrains Compose Multiplatform for iOS Reaches Alpha
source link: https://www.infoq.com/news/2023/05/compose-multiplatform-ios-alpha/?itm_source=infoq&itm_medium=popular_widget&itm_campaign=popular_content_list&itm_content=
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

JetBrains Compose Multiplatform for iOS Reaches Alpha
May 28, 2023 2 min read
After adding support for desktop apps and the Web, JetBrains multiplatform declarative UI toolkit now runs on iOS in alpha.
Based on Google Jetpack Compose, recently updated with improved performance and extensions, Compose Multiplatform runs natively on Android and, thanks to Kotlin Multiplatform on Windows, Linux, macOS, and the Web, too. The addition of iOS extends Compose Multiplatform to all major OSes.
The approach followed by Compose Multiplatform is to provide the same API across all supported platforms, replicating Jetpack Compose APIs:
The APIs in Compose Multiplatform are the same ones that have already been tried and tested in Jetpack Compose. That means developers who have experience writing modern Android user interfaces using Jetpack Compose can transfer those skills directly to write a shared user interface with Compose Multiplatform, targeting iOS and beyond.
This includes state management, layout composition, and animations. For a number of features that are strictly OS-dependent, like loading resources, Compose Multiplatform provides its own higher-level abstractions to maximize portability.
On iOS, Compose Multiplatform uses canvas-based rendering, using the Skiko graphics library. Also known as Skia for Kotlin, Skiko is based on Skia, Google's graphics library used for Chrome, ChromeOS, and Flutter.
This approach means that Compose Multiplatform apps have the same look and feel across all supported platforms, similarly to Flutter apps. Unlike Flutter, though, Compose Multiplatform provides Material and Material 3 widgets out of the box, so Compose Multiplatform apps will just look like plain-vanilla Android apps. While Material is the only widget look-and-feel currently supported on iOS, JetBrains has not yet made a final decision about whether to provide a native widget look-and-feel.
An important aspect of creating cross-platform apps is interoperability with the underlying OS SDK. Compose Multiplatform for iOS provides a two-way interop layer on top of UIKit
, with two main classes, UIKitView
and ComposeUIViewController
. UIKitView
enables embedding platform-specific widgets like maps, web views, media players, and camera feeds within a Compose UI. ComposeUIViewController
can be used instead to embed Compose screens in UIKit and SwiftUI applications. This can be helpful to gradually convert an existing app into a Compose app.
To start working with Compose Multiplatform for iOS, you will need a machine running recent version of macOS, Xcode, Android Studio, and the Kotlin Multiplatform Mobile plugin. All additional dependencies can be managed through CocoaPods.
The best place to start is one of the project templates provided by JetBrains. Those include a basic iOS/Android app, an image viewer, a chat app, and many more. A number of tutorials are also available to guide you through using the most common UI elements in a Compose Multiplatform app.
About the Author
Sergio De Simone
Sergio De Simone is a software engineer. Sergio has been working as a software engineer for over fifteen years across a range of different projects and companies, including such different work environments as Siemens, HP, and small startups. For the last few years, his focus has been on development for mobile platforms and related technologies. He is currently working for BigML, Inc., where he leads iOS and OS X development.
Show moreRecommend
-
6
Mobile Releases Kotlin Multiplatform Mobile Goes Alpha ...
-
6
News Compose Multiplatform goes Alpha, unifying Desktop, Web, and Android UIs
-
4
JetBrains Compose Multiplatform Reaches Beta Oct 31, 2021 2...
-
3
Firefly Aerospace's Alpha rocket reaches orbit for 1st time
-
8
SpaceflightFirefly Sends Alpha Rocket to Orbit, One Year After Explosive Launch AttemptThe company is just the fifth p...
-
3
Open-Source COBOL .NET Compiler Otterkit Reaches Alpha Mar 03, 2023 2...
-
6
Compose MultiplatformFast reactive Desktop and Web UI framework for Kotlin, based on Google’s modern toolkit and brou...
-
8
Mobile News Compose Multiplatform fo...
-
19
Compose Multiplatform — managing UI State on iOS
-
2
Compose-Multiplatform在Android和iOS上的实践 作者:狐友段梦瑶 2023-11-02 07:53:22 Compose-Multiplatform目前虽然还不成熟,但通过对其原理的分析,我们可以预见的是,结合KMM,未来将成为跨平台的有力竞争者...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK