JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.24k stars 1.11k forks source link

[ImageViewer/iOS] The function of sharing a picture ends with an infinite loop. #4970

Closed issamux closed 1 day ago

issamux commented 1 week ago

Describe the bug compose-multiplatform: examples: ImageViewer: The function of sharing a picture in iOS ends with an infinite loop.

Affected platforms

Affected code iosMain/example.imageviewer.storage.FileExtensions.kt

suspend fun NSURL.readData(): NSData {
   while (true) {
    val data = NSData.dataWithContentsOfURL(this)
    if (data != null)
        return data
    yield()
}

}

Versions

To Reproduce Steps to reproduce the behavior:

  1. Open and Build iOS project
  2. Click on Picture
  3. Scroll down to Share Button
  4. Click Share Button.
  5. No Response no result ( see video)

Expected behavior New Ui open to share selected picture

Screenshots/ Video

https://github.com/JetBrains/compose-multiplatform/assets/195905/110e1708-9d67-47aa-9d74-734e8cf3215c