I created a universal application (one view) in Xcode. Since I want to have an iAd banner for each view, I added this code to the AppDelegate file:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { if var root = self.window?.rootViewController { let contentFrame = UIScreen.mainScreen().bounds var _banner = ADBannerView(adType: ADAdType.Banner) _banner.frame=CGRectMake(0, contentFrame.height - _banner.frame.height, _banner.frame.width, _banner.frame.height) _banner.delegate = self root.view.addSubview(_banner) } return true }
On a real iPhone (iOS 8) Everything works fine (a banner appears on each view), but I get this error:
<Error>: CGAffineTransformInvert: singular matrix.
If I try to run this application on Simulator (iOS 8), then the behavior will be the same. Everything works fine, I get the same error, but moreover, I get: * ADBannerView:
Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=7 "The operation couldn't be completed. Ad was unloaded from this banner" UserInfo=0x7b83bf30 {ADInternalErrorCode=7, ADInternalErrorDomain=ADErrorDomain, NSLocalizedFailureReason=Ad was unloaded from this banner}*
But I have a delegate, and I implemented didFailToReceiveAdWithError . On a real iPhone, it works ...
My question is: how can I solve these two specific errors?
ios swift swift2 iad
André
source share