MortyComposeKMM icon indicating copy to clipboard operation
MortyComposeKMM copied to clipboard

snapshotList issue on ForEach

Open DidarSeyidov opened this issue 1 year ago • 7 comments

Type '((Any) throws -> Bool) throws -> Any?' cannot conform to 'RandomAccessCollection'

Only concrete types such as structs, enums and classes can conform to protocols

Required by generic struct 'ForEach' where 'Data' = '((Any) throws -> Bool) throws -> Any?'

DidarSeyidov avatar Oct 06 '24 07:10 DidarSeyidov

Thanks for the report. I just built/ran iOS client here and seemed to work. Are there any other factors you know about that might effect issue? I'm using Xcode 15.4 still here fwiw.

joreilly avatar Oct 06 '24 07:10 joreilly

I use xcode 16 and minimum ios version is 15.6

DidarSeyidov avatar Oct 06 '24 07:10 DidarSeyidov

how can I solve the issue. I do need pagination implementation on ios side of my kmp project

DidarSeyidov avatar Oct 06 '24 07:10 DidarSeyidov

hmm, I've tried with Xcode 16 and it seems to work

joreilly avatar Oct 06 '24 08:10 joreilly

The Kotlin 2.0.21-RC release is supposed to have better Xcode 16 support....might be worth trying with that there

joreilly avatar Oct 06 '24 09:10 joreilly

hmm, actually I use 'Kotlin 2.0.0'

DidarSeyidov avatar Oct 06 '24 09:10 DidarSeyidov

Kotlin version did not solve the issue, after that I casted MutableStateFlow<ItemSnapshotList<T>> to MutableStateFlow<List<T>> where RandomAccessCollection supports, the casting cannot solve it too, After checking type of declared variable in swiftUI (let snapshotList = self.viewModel.booksSnapshotList) I saw it gives ( let snapshotList: [Any] ) in both cases too. How dou you think is the issue can be on that

DidarSeyidov avatar Oct 06 '24 11:10 DidarSeyidov