-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
toUIImage returns nil for iOS #640
Comments
Could it be that this an issue with svgs? |
svg works in samples. svg on iOS require iOS 13+, check your iOS version please |
I am using the iOS 17, so I think that should not be the issue |
@Danijal98 please test your svg inside xcode project directly. maybe iOS for some reason can't process this svg |
I’m seeing a similar issue with an SVG file on iOS. Interestingly, while in light mode, I see the image (.toUIImage() returns non-nil). However, when I switch to dark mode, I don’t see the image (.toUIImage() returns nil). Maybe this clue helps? |
Is it maybe related to this one (should be fixed in the most recent version / beta)? |
Dark mode SVG images are indeed working. The comments for #624 provided the insight I needed - add an image resource with “-dark” appended to its name. I tested by copying “car_black.svg” to “car_black-dark.svg” and both light and dark mode now work as advertised. |
@Alex009 I can confirm that this bug does not occur anymore for me after upgrading to moko 0.24.1 |
I am using the version:
0.23.0
I have the following structure for my images:
shared/commonMain/resources/MR/images/ic_partnership.svg
I have a suggested helper method
From iOS I call it like this
The text was updated successfully, but these errors were encountered: