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

daspianist
  • 5,336
  • 8
  • 50
  • 94
  • 2
    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. – daspianist Nov 04 '20 at 10:41
  • 1
    Do you have very simple source code example on GitHub where on iOS 13 is working, but for iOS 14 is not working? – Ramis Nov 07 '20 at 17:09
  • 1
    @daspianist I don't think it's a keyboard specific issue, but rather UIImageView with iOS 14. You should go over these issue discussions: https://github.com/kaishin/Gifu/issues/167#issuecomment-709342376 and https://github.com/facebook/react-native/issues/29279#issuecomment-715229698 Maybe it will give you some kind of clue as to why this is happening in your app. – thedp Nov 09 '20 at 10:43
  • 1
    @thedp 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 issue – daspianist Nov 09 '20 at 10:56

1 Answers1

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.

daspianist
  • 5,336
  • 8
  • 50
  • 94