iOS 14 only issue: images in keyboard extension no longer displays (but works fine in iOS 13)
Asked Answered
S

1

6

I have an iOS keyboard extension that displays rows of UIImageViews in a scroll view.

Addendum, for clarity: the exact same codebase produces two very different results on two different iOS versions. There is no mention in the iOS 14 release notes for changes affecting keyboard extensions. Because of the differentiating results from iOS versions, I have no insight on what code to paste which may offer clues about what has caused this.

This question is open to those who may have insights or had experiences with iOS versions causing issues.

With the same codebase, on iOS 13, the rows of images show normally:

enter image description here

On the same device type with iOS 14, no images shows:

enter image description here

Sinker answered 3/11, 2020 at 18:35 Comment(4)
This question was cited by an anonymous user to be 'opinion-based' and was closed. I contest this notion: the same codebase that produces two very different results based on iOS versions - without the version releases notes explicitly stating what has changed to affect the change - is not opinion but code base, and a solution can help future users who have similar issues. iOS extension, and keyboard extensions, remain popular and is not niche. This issue could likely affect others as well.Sinker
Do you have very simple source code example on GitHub where on iOS 13 is working, but for iOS 14 is not working?Ebert
@Sinker I don't think it's a keyboard specific issue, but rather UIImageView with iOS 14. You should go over these issue discussions: github.com/kaishin/Gifu/issues/167#issuecomment-709342376 and github.com/facebook/react-native/issues/… Maybe it will give you some kind of clue as to why this is happening in your app.Scrambler
@Scrambler this is super helpful! Thanks so much for linking this. My hunch is that it could also be an UIImageView issue and not a keyboard extension issueSinker
S
2

As user @thedp helpfully pointed out in the comments to the question, this is indeed an UIImageView issue specific to iOS 14 that was not included in the release notes.

For easy browsing, here are the top resources I found:

And the resolution?

When the UIImage is initiated or being set, add:

layer.contentsScale = image.scale
layer.contents = image.cgImage

That was the resolution.

Sinker answered 12/11, 2020 at 16:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.