diff --git a/components/resources/library/src/iosMain/kotlin/org/jetbrains/compose/resources/Resource.ios.kt b/components/resources/library/src/iosMain/kotlin/org/jetbrains/compose/resources/Resource.ios.kt index 9d9be82c9a..fda8a5ddb7 100644 --- a/components/resources/library/src/iosMain/kotlin/org/jetbrains/compose/resources/Resource.ios.kt +++ b/components/resources/library/src/iosMain/kotlin/org/jetbrains/compose/resources/Resource.ios.kt @@ -5,6 +5,7 @@ package org.jetbrains.compose.resources +import kotlinx.cinterop.ExperimentalForeignApi import kotlinx.cinterop.addressOf import kotlinx.cinterop.usePinned import platform.Foundation.NSBundle @@ -17,6 +18,7 @@ actual fun resource(path: String): Resource = UIKitResourceImpl(path) @ExperimentalResourceApi private class UIKitResourceImpl(path: String) : AbstractResourceImpl(path) { + @OptIn(ExperimentalForeignApi::class) override suspend fun readBytes(): ByteArray { val fileManager = NSFileManager.defaultManager() // todo: support fallback path at bundle root? diff --git a/components/resources/library/src/macosMain/kotlin/org/jetbrains/compose/resources/Resource.macos.kt b/components/resources/library/src/macosMain/kotlin/org/jetbrains/compose/resources/Resource.macos.kt index becf5343ef..0e4dee9096 100644 --- a/components/resources/library/src/macosMain/kotlin/org/jetbrains/compose/resources/Resource.macos.kt +++ b/components/resources/library/src/macosMain/kotlin/org/jetbrains/compose/resources/Resource.macos.kt @@ -5,6 +5,7 @@ package org.jetbrains.compose.resources +import kotlinx.cinterop.ExperimentalForeignApi import kotlinx.cinterop.addressOf import kotlinx.cinterop.usePinned import platform.Foundation.NSData @@ -16,6 +17,7 @@ actual fun resource(path: String): Resource = MacOSResourceImpl(path) @ExperimentalResourceApi private class MacOSResourceImpl(path: String) : AbstractResourceImpl(path) { + @OptIn(ExperimentalForeignApi::class) override suspend fun readBytes(): ByteArray { val currentDirectoryPath = NSFileManager.defaultManager().currentDirectoryPath val contentsAtPath: NSData? = NSFileManager.defaultManager().run {