This is an unofficial port of the Mixpanel API to Cocoa, its built with cocoapods in mind.
-
Install CocoaPods with
gem install cocoapods
. -
Create a file in your XCode project called
Podfile
and add the following line:pod 'Mixpanel-OSX-Community'
-
Run
pod install
in your xcode project directory. CocoaPods should download and install the Mixpanel library, and create a new Xcode workspace. Open up this workspace in Xcode. -
Add the following to your
AppDelegate.m
:#import <Mixpanel/Mixpanel.h> - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [Mixpanel sharedInstanceWithToken:MIXPANEL_TOKEN]; }
-
Start tracking actions in your app:
[[Mixpanel sharedInstance] track:@"Watched video" properties:@{@"duration": @53}];
Check out the full documentation »