-3

I am trying to manually convert some code from Objective-C to Swift, but I only know how to use Swift.

ADBannerView *adView = [[ADBannerView alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height - 50, 320, 50)];
[self.view addSubview:adView];

I was able to convert the line starting with ADBannerView *adView = except for everything inside the CGRectMake(). I did not understand the second line starting with [self.view.

Please help. Thanks!

tobias_k
  • 81,265
  • 12
  • 120
  • 179

2 Answers2

1

If I correct understand what you need it will looks like:

var adView: ADBannerView = ADBannerView(frame: CGRectMake(0, self.view.frame.size.height - 50, 320, 50))
self.view.addSubview(adView)
anatoliy_v
  • 1,782
  • 15
  • 24
1
let adView = ADBannerView(frame: CGRect(x: 0, y: self.view.frame.size.height - 50, width: 320, height: 50))
self.view.addSubview(adView)
ChikabuZ
  • 10,031
  • 5
  • 63
  • 86