Skip to content
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

feat: replaced depricated apis with new ones for ui image #515

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

vibhor-d11
Copy link
Contributor

Building with Xcode 15 for iOS 17 lead to the run-time crash when using a deprecated UIGraphicsBeginImageContextWithOptions code on the UIImage instances with .zero size.

Following UI Image apis are depricated from ios 17 when build with Xcode 15:

https://developer.apple.com/documentation/uikit/1623912-uigraphicsbeginimagecontextwitho
https://developer.apple.com/documentation/uikit/1623924-uigraphicsgetimagefromcurrentima

Instead need to use UIGraphicsImageRenderer and UIGraphicsImageRendererContext. Have replaced them in this pr.

@vibhor-d11
Copy link
Contributor Author

@gre can we merge it?

@gre gre merged commit 1881b46 into gre:master Apr 5, 2024
@gre
Copy link
Owner

gre commented Apr 5, 2024

Thanks @vibhor-d11
i've merged it and release it under 4.0.0-alpha.2 so we can test it more. please let me know if everything works for you.

@AkashTureha
Copy link

Im getting blank image after adding this PR any reason why is that heppening.

@alanjhughes
Copy link
Contributor

alanjhughes commented Apr 24, 2024

I believe this is a regression. I am also receiving a blank image. Reverting these changes restores the correct behaviour.
Note: I have no issues running the previous code on iOS 17

@vibhor-d11
Copy link
Contributor Author

I believe this is a regression. I am also receiving a blank image. Reverting these changes restores the correct behaviour. Note: I have no issues running the previous code on iOS 17

Hello @alanjhughes @AkashTureha can you share steps to reproduce for when it is showing blank images? This patch is working fine for us and haven't encountered this issue for our users.

@alanjhughes
Copy link
Contributor

Hi @vibhor-d11 - to reproduce you only need to enable the new architecture.

@yasir6jan
Copy link

yasir6jan commented Jul 30, 2024

Hey @alanjhughes What is the version of Xcode you are using for building the app on iOS 17?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants