JMD
JMD

Reputation: 69

Remove iAd banner from one scene

I have a basic game created with 3 scenes - Start, GameScene, and Gameover Scene. I've implemented iAd banners using the code shown below. This was simple for me, as a beginner, to do. However, the banner ad seems to be impacting the frame rate during game play so I want it to be removed/hidden during the game scene. Is there an easy way to accomplish this?

override func viewDidLoad() {
    super.viewDidLoad()
    self.canDisplayBannerAds = true
}

Upvotes: 1

Views: 239

Answers (1)

Daniel Storm
Daniel Storm

Reputation: 18878

In the game scene where you'd like to hide the ADBannerView set self.canDisplayBannerAds = false. Alternatively, you could create the ADBannerView programmatically and set its hidden property to true.

Upvotes: 1

Related Questions