I'm following the instructions on here to integrate google analytics into my app: https://developers.google.com/analytics/devguides/collection/ios/v3/?ver=swift#get-config
I'm at the point where I need to initialize analytics for my app. I've added this code in my AppDelegate.swift file:
import UIKit
import <Google/Analytics.h>
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions:[NSObject: AnyObject]?) -> Bool {
**// Configure tracker from GoogleService-Info.plist.
NSError *configureError;
[[GGLContext sharedInstance] configureWithError:&configureError];
NSAssert(!configureError, @"Error configuring Google services: %@", configureError);
// Optional: configure GAI options.
GAI *gai = [GAI sharedInstance];
gai.trackUncaughtExceptions = YES; // report uncaught exceptions
gai.logger.logLevel = kGAILogLevelVerbose; // remove before app release**
}
I'm getting the following error messages.
For my
import <Google/Analytics.h>
line, I'm getting this message:'Consecutive statements on a line must be separated by ';'.For the rest of the code I'm getting several errors, although I simply copied the code in the tutorial into my file. See my screenshot.