alexhillc / AXPhotoViewer

An iOS/tvOS photo gallery viewer, useful for viewing a large (or small!) number of photos.
https://www.cocoacontrols.com/controls/axphotoviewer
MIT License
646 stars 119 forks source link

Add AdMob Banner at the bottom of PhotoViewController #20

Closed jsonmat closed 6 years ago

jsonmat commented 6 years ago

Hello there!

alexhillc commented 6 years ago

Hi @jsonmat, you could easily accomplish this without making any changes to the library at all. There is a property on the PhotosVC overlay that allows for self-sizing views to be added to the view hierarchy:

let selfSizingAdView = SelfSizingAdViewContainer()
let photosViewController = PhotosViewController()
photosViewController.overlayView.bottomStackContainer.insertSubview(selfSizingAdViewContainer, at: 0)

Please note that in the above example, the SelfSizingAdViewContainer class will implement the method: UIView.sizeThatFits(_:).