awkward / Tatsi

A drop-in replacement for UIImagePickerController with the ability to select multiple images and/or videos
MIT License
110 stars 30 forks source link

Small 50x50 thumbnails on iOS 13 when modalPresentationStyle is fullscreen #25

Closed igorkulman closed 4 years ago

igorkulman commented 4 years ago

iOS 13 change the default modalPresentationStyle. If you set it to .fullscreen on TatsiPickerViewController before presenting it, the thumbnails are too small, just 50x50px

Simulator Screen Shot - iPhone X - 2019-09-30 at 14 03 01

If you set it to .pageSheet it looks correct with 100x100 thumbnails

Simulator Screen Shot - iPhone X - 2019-09-30 at 14 01 43

It looks like it is caused by AssetsGridViewController.traitCollectionDidChange not being called with modalPresentationStyle =.fullscreen`.

I did some research and found this

If you rely on size changes to build adaptive layouts, you should review your code for iOS 13. UIKit now predicts the initial traits for a view so you cannot assume traitCollectionDidChange will be called when a view is first added to the view hierarchy.

Adding updateCollectionViewLayout() to AssetsGridViewController.viewDidLoad seems to help, but I am not sure it is the best solution.