[ad_1]
I wish to show IronSource advertisements in my Swift app. i can see the advert at backside which is by default however i wish to present advertisements at customise place not at backside , like i did for AdMob and Meta Adverts. however this time its not working ..
that is my codes..
var bannerView: ISBannerView! = nil
and that is my UIView outlet in VC.
@IBOutlet weak var banner: UIView!
in View did Load
let BNSize: ISBannerSize = ISBannerSize(description: "LARGE",width:320 ,peak:90)
IronSource.loadBanner(with: self, measurement: BNSize )
after which in func my code is one thing like this ..
func bannerDidLoad(_ bannerView: ISBannerView!) {
self.bannerView=bannerView
if #obtainable(iOS 11.0, *) {
bannerView.body = CGRect(x: view.body.measurement.width/2 - bannerView.body.measurement.width/2, y: view.body.measurement.peak - bannerView.body.measurement.peak, width: bannerView.body.measurement.width, peak: bannerView.body.measurement.peak - self.view.safeAreaInsets.backside * 2.5)
} else {
bannerView.body = CGRect(x: view.body.measurement.width/2 - bannerView.body.measurement.width/2, y: view.body.measurement.peak - bannerView.body.measurement.peak, width: bannerView.body.measurement.width, peak: bannerView.body.measurement.peak * 2.5)
}
view.addSubview(bannerView)
logFunctionName()
}
i’ve tried this to show advertisements in my UIView
view.addSubview(banner)
however it didn’t work tried to take away CGRect additionally didn’t work for me , i’ve additionally tried change self.bannerView=bannerView to self.bannerView=banner and vice versa, however nonetheless not working , please are you able to assist me out ?
[ad_2]
