LeoNatan / LNPopupController

A framework for presenting view controllers as popups of other view controllers, much like the Apple Music and Podcasts apps.
MIT License
3.04k stars 342 forks source link

What is the proper way to get coordinates of the Popup Close Button? #432

Closed darkForestCat closed 3 years ago

darkForestCat commented 3 years ago

Question

I am using rounded close button.What is the proper way to get it's center, minX and minY, frame or something that could help me drawing my stuff behind it :)

LeoNatan commented 3 years ago

Hello,

There are several approaches you can take. The button is accessible to you from popupContentView.popupCloseButton. You can then calculate where it is and do what you need to do. A better approach is to implement positionPopupCloseButton(_:) and position the close button in your hierarchy. You then take ownership of the button and its position.