is anyone else not seeing composeResources availab...
# multiplatform
b
is anyone else not seeing composeResources available in iOS due to them not being here when using cocoapods?
spec.resources = ['build/compose/ios/<name>/compose-resources']
?
j
No, working for me with cocoapods + compose resources.
b
hmm the
Res
also isn;t generating for me for some reason
j
Feels like you have invalid setup then. Sometimes need to rebuild the project to get Res resolved after apply the compose components resources plugin 🙂
b
your talking about this right?
Copy code
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
implementation(compose.components.resources)
j
Yes, that should be pretty much it. And move your files to commonMain/composeResources. Keep in mind need put the files in a certain subfolder structure.
Also double check your XCode build phases include the resources as well 🙂
You can only get the resources in iOS in one entrypoint, such as shared module and include into the process 🙂
b
ah its been silently not showing errors until i updated to 1.6.0-beta02
is drawable-dark not the right folder name?
j
Hmm sounds wrong, I think its night, like composeResources/drawable/night/myfile.xml or something in that direction. Look at https://developer.android.com/guide/topics/resources/providing-resources Also be aware that CMP resources do not support all qualifiers yet.
b
yeah inspected code in AS
oops
themequalifier
light/dark
j
I havent tested this particular one though. So not entirely sure if its drawable-dark or drawable/dark. From what I recall in Android I think was night vs light or something like that.
Also I guess need to have multiple qualifier subfolders to resolve all variants. But in commonMain should be same reference in Res 🙂
b
drawable-* works for density
its either not implemented in CMP yet or its a bug
this works for now
Copy code
internal val Res.drawable.botstacks_logo_daynight: DrawableResource
    @Composable get() = if (LocalBotStacksColorScheme.current.isDark) botstacks_logo_dark else botstacks_logo
with files in drawable/
j
Could be they using another name internally for light vs dark, not sure. But its easy to test and set breakpoints in compose resources sorce code and see what complete path it evaluates.