hyperoslo / Lightbox

:milky_way: A convenient and easy to use image viewer for your iOS app
https://www.hyper.no
Other
1.62k stars 326 forks source link

Move configureLayout(_) in viewDidLayoutSubviews() #267

Closed davidevincenzi closed 3 years ago

davidevincenzi commented 3 years ago

This PR fixes a little issue I got when using Lightbox with SwiftUI, when showed as a modal. What happened was that the layout is adjusted to make space for the text below the image only after the view appeared. Expected behavior since the configureLayout(_) was in viewDidAppear... By configuring the layout inside viewDidLayoutSubviews(), when the view appears, it is configured with the final frame but before presentation, which makes the UI correct when it is presenting (before viewDidAppear is called).

3lvis commented 3 years ago

Thank you!