Reputation: 309
Google's code for screen tracking isn't working in swift 3.0 This is the code:
let tracker = GAI.sharedInstance().defaultTracker
tracker.set(kGAIScreenName, value: name)
let builder = GAIDictionaryBuilder.createScreenView()
tracker.send(builder.build() as [NSObject : AnyObject])
I am getting the following error: "cannot convert value of type NSMutableDictionary? to type [NSObject: AnyObject] in coercion". Any help please?
Upvotes: 0
Views: 684
Reputation: 9352
Cast to NSDictionary first. This works:
tracker.send(builder.build() as NSDictionary as [NSObject : AnyObject])
Upvotes: 2