Luna Debb
Luna Debb

Reputation: 69

UIView added as Overlay In AVPlayer won't fire any action when touched

Issue: I have an AVPlayer where I overlaid a View with a nested view that fires an action when pressed (GADBannerView). However, when pressed, it doesn't do anything nor It registers touches.

Test Code

let adBanner: UIView = {
 let view = UIView()
 view.addSubview(GADBannerAlreadyInstantiatedView())
return view
}()


AVPC = AVPlayerViewController()
AVPC!.player = self.contentPlayer
AVPC.addSubView(AdBanner)

Expected I should be sent to watch the ad in a new window, but instead, it doesn't do anything. Only the AVPlayer controls react.

Upvotes: 0

Views: 165

Answers (1)

matt
matt

Reputation: 535989

The problem is that the adBanner has zero size (because you gave it no frame). A subview of a view with zero size, like your gad banner view, can be seen but cannot be touched.

Upvotes: 1

Related Questions