Skip to content

Instantly share code, notes, and snippets.

@ChrisRisner
Last active December 11, 2015 09:58
Show Gist options
  • Save ChrisRisner/4583489 to your computer and use it in GitHub Desktop.
Save ChrisRisner/4583489 to your computer and use it in GitHub Desktop.
iOS Day 30
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:@"UA-37819494-1"];
return YES;
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[GAI sharedInstance].trackUncaughtExceptions = YES;
[GAI sharedInstance].dispatchInterval = 20;
[GAI sharedInstance].debug = YES;
id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:@"UA-37819494-1"];
return YES;
}
- (IBAction)tappedButtonOne:(id)sender {
id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
[tracker sendEventWithCategory:@"MyFirstScreen"
withAction:@"ButtonPress"
withLabel:@"ButtonOne"
withValue:nil];
}
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@property (weak, nonatomic) IBOutlet UITextField *txtInfo;
- (IBAction)tappedButtonOne:(id)sender;
@end
#import <UIKit/UIKit.h>
#import "GAITrackedViewController.h"
@interface ViewController : GAITrackedViewController
@property (weak, nonatomic) IBOutlet UITextField *txtInfo;
- (IBAction)tappedButtonOne:(id)sender;
@end
- (void)viewDidLoad
{
[super viewDidLoad];
self.trackedViewName = @"My First Screen";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment