From c1c041af274fc559ac3a1d9d485533350ef37846 Mon Sep 17 00:00:00 2001 From: "John C. Daub" Date: Thu, 7 May 2015 05:39:49 -0500 Subject: [PATCH 01/10] Initial project template for sample app. Adding a Podfile (and Gemfile) to help with a few things to make sample distribution buildable and a little easier to distribute. .gitignore updated to ignore the Pods folder. --- .gitignore | 2 +- Example/Gemfile | 4 + .../project.pbxproj | 428 ++++++++++++++++++ Example/HEAnalyticsExample/AppDelegate.swift | 46 ++ .../Base.lproj/LaunchScreen.xib | 41 ++ .../Base.lproj/Main.storyboard | 111 +++++ .../FirstViewController.swift | 25 + .../AppIcon.appiconset/Contents.json | 38 ++ .../first.imageset/Contents.json | 12 + .../Images.xcassets/first.imageset/first.pdf | Bin 0 -> 2465 bytes .../second.imageset/Contents.json | 12 + .../second.imageset/second.pdf | Bin 0 -> 2423 bytes Example/HEAnalyticsExample/Info.plist | 50 ++ .../SecondViewController.swift | 25 + .../HEAnalyticsExampleTests.swift | 36 ++ Example/HEAnalyticsExampleTests/Info.plist | 24 + Example/Podfile | 8 + 17 files changed, 861 insertions(+), 1 deletion(-) create mode 100644 Example/Gemfile create mode 100644 Example/HEAnalyticsExample.xcodeproj/project.pbxproj create mode 100644 Example/HEAnalyticsExample/AppDelegate.swift create mode 100644 Example/HEAnalyticsExample/Base.lproj/LaunchScreen.xib create mode 100644 Example/HEAnalyticsExample/Base.lproj/Main.storyboard create mode 100644 Example/HEAnalyticsExample/FirstViewController.swift create mode 100644 Example/HEAnalyticsExample/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Example/HEAnalyticsExample/Images.xcassets/first.imageset/Contents.json create mode 100644 Example/HEAnalyticsExample/Images.xcassets/first.imageset/first.pdf create mode 100644 Example/HEAnalyticsExample/Images.xcassets/second.imageset/Contents.json create mode 100644 Example/HEAnalyticsExample/Images.xcassets/second.imageset/second.pdf create mode 100644 Example/HEAnalyticsExample/Info.plist create mode 100644 Example/HEAnalyticsExample/SecondViewController.swift create mode 100644 Example/HEAnalyticsExampleTests/HEAnalyticsExampleTests.swift create mode 100644 Example/HEAnalyticsExampleTests/Info.plist create mode 100644 Example/Podfile diff --git a/.gitignore b/.gitignore index 8615121..0cfdf50 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,7 @@ DerivedData # you should judge for yourself, the pros and cons are mentioned at: # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control # -# Pods/ +Pods/ # Carthage # diff --git a/Example/Gemfile b/Example/Gemfile new file mode 100644 index 0000000..65b258a --- /dev/null +++ b/Example/Gemfile @@ -0,0 +1,4 @@ +source "https://rubygems.org" + +gem "cocoapods", "0.36.4" +gem "CFPropertyList", "2.3.1" diff --git a/Example/HEAnalyticsExample.xcodeproj/project.pbxproj b/Example/HEAnalyticsExample.xcodeproj/project.pbxproj new file mode 100644 index 0000000..71bf60f --- /dev/null +++ b/Example/HEAnalyticsExample.xcodeproj/project.pbxproj @@ -0,0 +1,428 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 791FBE711AFB76F000E3453C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 791FBE701AFB76F000E3453C /* AppDelegate.swift */; }; + 791FBE731AFB76F000E3453C /* FirstViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 791FBE721AFB76F000E3453C /* FirstViewController.swift */; }; + 791FBE751AFB76F000E3453C /* SecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 791FBE741AFB76F000E3453C /* SecondViewController.swift */; }; + 791FBE781AFB76F000E3453C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 791FBE761AFB76F000E3453C /* Main.storyboard */; }; + 791FBE7A1AFB76F000E3453C /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 791FBE791AFB76F000E3453C /* Images.xcassets */; }; + 791FBE7D1AFB76F000E3453C /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 791FBE7B1AFB76F000E3453C /* LaunchScreen.xib */; }; + 791FBE891AFB76F000E3453C /* HEAnalyticsExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 791FBE881AFB76F000E3453C /* HEAnalyticsExampleTests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 791FBE831AFB76F000E3453C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 791FBE631AFB76F000E3453C /* Project object */; + proxyType = 1; + remoteGlobalIDString = 791FBE6A1AFB76F000E3453C; + remoteInfo = HEAnalyticsExample; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 791FBE6B1AFB76F000E3453C /* HEAnalyticsExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HEAnalyticsExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 791FBE6F1AFB76F000E3453C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 791FBE701AFB76F000E3453C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 791FBE721AFB76F000E3453C /* FirstViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirstViewController.swift; sourceTree = ""; }; + 791FBE741AFB76F000E3453C /* SecondViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecondViewController.swift; sourceTree = ""; }; + 791FBE771AFB76F000E3453C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 791FBE791AFB76F000E3453C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 791FBE7C1AFB76F000E3453C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; + 791FBE821AFB76F000E3453C /* HEAnalyticsExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HEAnalyticsExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 791FBE871AFB76F000E3453C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 791FBE881AFB76F000E3453C /* HEAnalyticsExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HEAnalyticsExampleTests.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 791FBE681AFB76F000E3453C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 791FBE7F1AFB76F000E3453C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 791FBE621AFB76F000E3453C = { + isa = PBXGroup; + children = ( + 791FBE6D1AFB76F000E3453C /* HEAnalyticsExample */, + 791FBE851AFB76F000E3453C /* HEAnalyticsExampleTests */, + 791FBE6C1AFB76F000E3453C /* Products */, + ); + sourceTree = ""; + }; + 791FBE6C1AFB76F000E3453C /* Products */ = { + isa = PBXGroup; + children = ( + 791FBE6B1AFB76F000E3453C /* HEAnalyticsExample.app */, + 791FBE821AFB76F000E3453C /* HEAnalyticsExampleTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 791FBE6D1AFB76F000E3453C /* HEAnalyticsExample */ = { + isa = PBXGroup; + children = ( + 791FBE701AFB76F000E3453C /* AppDelegate.swift */, + 791FBE721AFB76F000E3453C /* FirstViewController.swift */, + 791FBE741AFB76F000E3453C /* SecondViewController.swift */, + 791FBE761AFB76F000E3453C /* Main.storyboard */, + 791FBE791AFB76F000E3453C /* Images.xcassets */, + 791FBE7B1AFB76F000E3453C /* LaunchScreen.xib */, + 791FBE6E1AFB76F000E3453C /* Supporting Files */, + ); + path = HEAnalyticsExample; + sourceTree = ""; + }; + 791FBE6E1AFB76F000E3453C /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 791FBE6F1AFB76F000E3453C /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 791FBE851AFB76F000E3453C /* HEAnalyticsExampleTests */ = { + isa = PBXGroup; + children = ( + 791FBE881AFB76F000E3453C /* HEAnalyticsExampleTests.swift */, + 791FBE861AFB76F000E3453C /* Supporting Files */, + ); + path = HEAnalyticsExampleTests; + sourceTree = ""; + }; + 791FBE861AFB76F000E3453C /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 791FBE871AFB76F000E3453C /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 791FBE6A1AFB76F000E3453C /* HEAnalyticsExample */ = { + isa = PBXNativeTarget; + buildConfigurationList = 791FBE8C1AFB76F000E3453C /* Build configuration list for PBXNativeTarget "HEAnalyticsExample" */; + buildPhases = ( + 791FBE671AFB76F000E3453C /* Sources */, + 791FBE681AFB76F000E3453C /* Frameworks */, + 791FBE691AFB76F000E3453C /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = HEAnalyticsExample; + productName = HEAnalyticsExample; + productReference = 791FBE6B1AFB76F000E3453C /* HEAnalyticsExample.app */; + productType = "com.apple.product-type.application"; + }; + 791FBE811AFB76F000E3453C /* HEAnalyticsExampleTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 791FBE8F1AFB76F000E3453C /* Build configuration list for PBXNativeTarget "HEAnalyticsExampleTests" */; + buildPhases = ( + 791FBE7E1AFB76F000E3453C /* Sources */, + 791FBE7F1AFB76F000E3453C /* Frameworks */, + 791FBE801AFB76F000E3453C /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 791FBE841AFB76F000E3453C /* PBXTargetDependency */, + ); + name = HEAnalyticsExampleTests; + productName = HEAnalyticsExampleTests; + productReference = 791FBE821AFB76F000E3453C /* HEAnalyticsExampleTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 791FBE631AFB76F000E3453C /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0640; + ORGANIZATIONNAME = "Hsoi Enterprises LLC"; + TargetAttributes = { + 791FBE6A1AFB76F000E3453C = { + CreatedOnToolsVersion = 6.4; + }; + 791FBE811AFB76F000E3453C = { + CreatedOnToolsVersion = 6.4; + TestTargetID = 791FBE6A1AFB76F000E3453C; + }; + }; + }; + buildConfigurationList = 791FBE661AFB76F000E3453C /* Build configuration list for PBXProject "HEAnalyticsExample" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 791FBE621AFB76F000E3453C; + productRefGroup = 791FBE6C1AFB76F000E3453C /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 791FBE6A1AFB76F000E3453C /* HEAnalyticsExample */, + 791FBE811AFB76F000E3453C /* HEAnalyticsExampleTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 791FBE691AFB76F000E3453C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 791FBE781AFB76F000E3453C /* Main.storyboard in Resources */, + 791FBE7D1AFB76F000E3453C /* LaunchScreen.xib in Resources */, + 791FBE7A1AFB76F000E3453C /* Images.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 791FBE801AFB76F000E3453C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 791FBE671AFB76F000E3453C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 791FBE751AFB76F000E3453C /* SecondViewController.swift in Sources */, + 791FBE711AFB76F000E3453C /* AppDelegate.swift in Sources */, + 791FBE731AFB76F000E3453C /* FirstViewController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 791FBE7E1AFB76F000E3453C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 791FBE891AFB76F000E3453C /* HEAnalyticsExampleTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 791FBE841AFB76F000E3453C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 791FBE6A1AFB76F000E3453C /* HEAnalyticsExample */; + targetProxy = 791FBE831AFB76F000E3453C /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 791FBE761AFB76F000E3453C /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 791FBE771AFB76F000E3453C /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 791FBE7B1AFB76F000E3453C /* LaunchScreen.xib */ = { + isa = PBXVariantGroup; + children = ( + 791FBE7C1AFB76F000E3453C /* Base */, + ); + name = LaunchScreen.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 791FBE8A1AFB76F000E3453C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.4; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 791FBE8B1AFB76F000E3453C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.4; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 791FBE8D1AFB76F000E3453C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = HEAnalyticsExample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 791FBE8E1AFB76F000E3453C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = HEAnalyticsExample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 791FBE901AFB76F000E3453C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = HEAnalyticsExampleTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HEAnalyticsExample.app/HEAnalyticsExample"; + }; + name = Debug; + }; + 791FBE911AFB76F000E3453C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = HEAnalyticsExampleTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HEAnalyticsExample.app/HEAnalyticsExample"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 791FBE661AFB76F000E3453C /* Build configuration list for PBXProject "HEAnalyticsExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 791FBE8A1AFB76F000E3453C /* Debug */, + 791FBE8B1AFB76F000E3453C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 791FBE8C1AFB76F000E3453C /* Build configuration list for PBXNativeTarget "HEAnalyticsExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 791FBE8D1AFB76F000E3453C /* Debug */, + 791FBE8E1AFB76F000E3453C /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 791FBE8F1AFB76F000E3453C /* Build configuration list for PBXNativeTarget "HEAnalyticsExampleTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 791FBE901AFB76F000E3453C /* Debug */, + 791FBE911AFB76F000E3453C /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 791FBE631AFB76F000E3453C /* Project object */; +} diff --git a/Example/HEAnalyticsExample/AppDelegate.swift b/Example/HEAnalyticsExample/AppDelegate.swift new file mode 100644 index 0000000..39b4871 --- /dev/null +++ b/Example/HEAnalyticsExample/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// HEAnalyticsExample +// +// Created by hsoi on 5/7/15. +// Copyright (c) 2015 Hsoi Enterprises LLC. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(application: UIApplication) { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/Example/HEAnalyticsExample/Base.lproj/LaunchScreen.xib b/Example/HEAnalyticsExample/Base.lproj/LaunchScreen.xib new file mode 100644 index 0000000..525a7e7 --- /dev/null +++ b/Example/HEAnalyticsExample/Base.lproj/LaunchScreen.xib @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/HEAnalyticsExample/Base.lproj/Main.storyboard b/Example/HEAnalyticsExample/Base.lproj/Main.storyboard new file mode 100644 index 0000000..77ba998 --- /dev/null +++ b/Example/HEAnalyticsExample/Base.lproj/Main.storyboard @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/HEAnalyticsExample/FirstViewController.swift b/Example/HEAnalyticsExample/FirstViewController.swift new file mode 100644 index 0000000..cf2f9f8 --- /dev/null +++ b/Example/HEAnalyticsExample/FirstViewController.swift @@ -0,0 +1,25 @@ +// +// FirstViewController.swift +// HEAnalyticsExample +// +// Created by hsoi on 5/7/15. +// Copyright (c) 2015 Hsoi Enterprises LLC. All rights reserved. +// + +import UIKit + +class FirstViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + +} + diff --git a/Example/HEAnalyticsExample/Images.xcassets/AppIcon.appiconset/Contents.json b/Example/HEAnalyticsExample/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..118c98f --- /dev/null +++ b/Example/HEAnalyticsExample/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,38 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/HEAnalyticsExample/Images.xcassets/first.imageset/Contents.json b/Example/HEAnalyticsExample/Images.xcassets/first.imageset/Contents.json new file mode 100644 index 0000000..33a7451 --- /dev/null +++ b/Example/HEAnalyticsExample/Images.xcassets/first.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "first.pdf" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/HEAnalyticsExample/Images.xcassets/first.imageset/first.pdf b/Example/HEAnalyticsExample/Images.xcassets/first.imageset/first.pdf new file mode 100644 index 0000000000000000000000000000000000000000..47d911dea647d55983671ead4d08b6f6b3600715 GIT binary patch literal 2465 zcmai03se(l7FLvisY+L#f-EBsK`11Xkc1=%MIujmB|xQ!>5vQ%APFP`Mlf5nSPOKE z2-^C>7DZkM!J;Da5{kfrC?Kvp3J41-3shFXvhuJqKo*oer*r0H{{P-P_x0cTzLzjD!bE z0qT;#Q7l4Gy%fMoXJaKT`@{5#R(MOqJPwQifv8iK6A%Ot9L14h2`38T!2s4PM=1!< zmL06}VYAA|ay#jZRs>HpA%X+eQW4rufWU%d1w5GTy!X#LeZsF_+~ccZmn3Fi)v^Z; zIG;?uU*yLLEYs61tjD>gXOFvSWsh{48xJvPNqKrIJtMdCz2cA2aC7TF?b@K`V!Lw- zE;zpH&ApqhoRjAHt}gK}>(qAc8dvrkD31*`<5<%C(&4_LqhQ3-GOf8~n^leG?+-@@^pjPa$J2gW@O)!b9hdTJ zTauyIJ&~rqeEZC1p9dWgx7{_WRc2=drMO=wcT7B{Zd58z`d)r_36r4V<6PGkCjpGfbnVMtm@;b}F!T?)Qav$_y7H5T;Mf!T}M zWxP9TNqrV?e5;b|pWd3^u2KAatk&3aDB@0 zZBaQNdCZ2#fblzYZnRCCjQ-GQWb-s8bX&<)?SxnUGdDYVFVk`xIf7@g3~$DX`H71_;r5OSZz1p`$_8y_9 z{;MJJ+n=>7Ewg;GnGHoz)&ID0z@F2!e$F7cWQ?d6s(!VY)_Gw})xCyMvsD={5i&H* zAIr_ACo8;Se6<*!-mm9Am79Iz^RVlc?%S5sg|E*SyIV{dd9{Mpf#d3cih5WKt=%ps zBEo)bt8EjmeCFYJRYU|b7d`p+-V|X2wOCYtyLP6t=!WH-kgdf0A};ytPfZiCwVPx{ z`g;zpe{8a4RQxQUwVU02<4X3w|9h;}XjhGWquqn{vVqq8g{*}BQF9=ybe_TM*!M=rFs1pN)yzctIXAoicsCe6>fit>wgZ#vp^hZOY0`J`rx zwdSK?GwR_xm9;5XjH|vf{O+Yg-)z;s*xt>;-vU`D-_SK<=~4eEVQkV~57{vyH6ebu>DqwE~Mx_A31Lg~$ zy`i52ew?GEluE%AN>ju*5z~dx2QQLP-G+E>o|En2+s&<^4*d zWD+<8PXs_Jp7_5Dpi(Gg3J?M;%Rn0{dcxQRh!ip+iHJ_e`!bM1MGxwI8Iedr+x>wI zq@&04fsADHfBccq^gpm8Q_u-~Uj|Z$YwSR(^_mzUb!}Xb2Cj`uqphg}v_Y%?Fs=;= zWq3s{hy)Tu!ji@RJsd$C+G{F6V2j1*Xk+7xo|LO7M2yb)(wc=%x-AclP9pLsbTF7m tf?*P!2EjJu5MD57P32Q4pdJ3tO_shCDT2=K;$ebx8ymcd$v!V9{2$sQiO>K5 literal 0 HcmV?d00001 diff --git a/Example/HEAnalyticsExample/Images.xcassets/second.imageset/Contents.json b/Example/HEAnalyticsExample/Images.xcassets/second.imageset/Contents.json new file mode 100644 index 0000000..03bd9c9 --- /dev/null +++ b/Example/HEAnalyticsExample/Images.xcassets/second.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "second.pdf" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/HEAnalyticsExample/Images.xcassets/second.imageset/second.pdf b/Example/HEAnalyticsExample/Images.xcassets/second.imageset/second.pdf new file mode 100644 index 0000000000000000000000000000000000000000..401614e288b4b160471c2776bed6f09762af3e1c GIT binary patch literal 2423 zcmai02~-nz8dqq7rWU#)x2z)&iMWtV?gK$2a)?|BP!TbkV}J-Gl1wmy+3G9S0=uOY zwCjai6uBOPMMdNiN`VDYKwLQr2#W^`R93*Ua=0^)EGYY4=grIf|KIohziYnv{elnR zdN_hk6db<(+3RPcxs!iut8c(j0TLh=9mY931H^rhEE0|aXo!dh5Iv+ZFr+}9F+v#P zLSnfD0$f~hN>~92V{z)WJA&2)5rW!|I?;o?oI*%zejJiuY>hFLQwKlAa9O+PnPh#% zJp~JAfs-De6u@;{cREMs}D-sGib_4>50m8_|Uj-zC0m@Qx zJV+^5Da4Qxpf3sBtKZs<_aI$Cb1T+h<->yL^rfiGNelYkqgC3#SqVP_iy*_RPcbjH)xYf zvYdC-)D_t8c{=5%;$VJQxs_#61J*kuXMC?|&PbPo-7uSxoNr~&J94|gKk+03JGXXM zx4w~=^VUzWqQveu_ilRgPdgNNdnLZCH`=;w91}cP5ihdm*B_jI+rk=Pz2Lk!)XUu| zkls3P5&YHJ!t0kF+MUVBHOAx)a zy|JxHNd37z*~b5#%*0w_F|#4?erNP;pG`Fevoq2%?9Y>%Cmzv1(ks;aPIGaiy1mhU zr{7lB^Mem&`QK{b{uiDC zLD8muY(FNk{YdV|zO#o_VB%);8|~Bh(Z4p?GM}g-HN2;q7~YNl-lD~HZ$taYw$Fzbn6c?c5eo=@`i>()el#qwB)hI-gp0 ztsw@dh-I5NJkk)RCoBC`L8ffKfY)=oG=#4LA9TO6eA}9~@a6dupB+=S{%s&NY}^0GY`hAqod)uxXHitrN%bWOJohV>t?!&Z#d4y^7J@=Oh`HV zee**4j>xRUd)|D0^I-B#<`m1-5PO{)!v(q?ecFYqr_8Q{+z7#n0uFbq%_?hZ-Ck(6NRn=vDS7Nb1Xxx_)9`!i- zGR>av*PJ+P_AGO*a_$FbtCCISg5PK44p&W#t$)+HVcxpR9LAL%_Pv$p`0tO*sYZD0 zCG3-ipr4WoVbjpw%Nf^r^rnWcDcjumgBPEjO;NM6QtZ8wU#0rjHx5zs%CahF4$W*U zxu!q8kYP+>v!BNPVIRJUGIWU@7qVvx2VZDw4gV8%z%bjpF#aF(W|PmliwlakuRq>= zhaCRc^R!7T)#Twb0{!Tns=CxGcGX|leErg`f3|v0eBXxHU&6Sj-_>zOL!!d+j5Xt* zPS;rWd^zEF{5d5%)nNK=)zFJ8Uc=aQKD%UK)_TNes1Gh{SD*Mb_@O` z7*zs9Uq~Vq?v|^8FcM-yLGMKzR3YFB0z@CFM2X-dio%Gu6&MJj=I?uS7sA3AdE^p8 zE49$PjJzPIJwfn;jso7X2#jynr3dO@p5QAK1O9wqKLC=PkQjj~p#n|-5O`ihbTzzu zL{}2QEe28pJYfVZRW56FL`LvO&|C^1Th{0}hQMW$Ng$QPpnzlwnMnf=kVy8(y==L% zLMa>r0gELdT + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.hsoienterprises.heanalyticssample.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarTintParameters + + UINavigationBar + + Style + UIBarStyleDefault + Translucent + + + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Example/HEAnalyticsExample/SecondViewController.swift b/Example/HEAnalyticsExample/SecondViewController.swift new file mode 100644 index 0000000..197ce87 --- /dev/null +++ b/Example/HEAnalyticsExample/SecondViewController.swift @@ -0,0 +1,25 @@ +// +// SecondViewController.swift +// HEAnalyticsExample +// +// Created by hsoi on 5/7/15. +// Copyright (c) 2015 Hsoi Enterprises LLC. All rights reserved. +// + +import UIKit + +class SecondViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + +} + diff --git a/Example/HEAnalyticsExampleTests/HEAnalyticsExampleTests.swift b/Example/HEAnalyticsExampleTests/HEAnalyticsExampleTests.swift new file mode 100644 index 0000000..fdd0cd9 --- /dev/null +++ b/Example/HEAnalyticsExampleTests/HEAnalyticsExampleTests.swift @@ -0,0 +1,36 @@ +// +// HEAnalyticsExampleTests.swift +// HEAnalyticsExampleTests +// +// Created by hsoi on 5/7/15. +// Copyright (c) 2015 Hsoi Enterprises LLC. All rights reserved. +// + +import UIKit +import XCTest + +class HEAnalyticsExampleTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + XCTAssert(true, "Pass") + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measureBlock() { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/Example/HEAnalyticsExampleTests/Info.plist b/Example/HEAnalyticsExampleTests/Info.plist new file mode 100644 index 0000000..4ddcc23 --- /dev/null +++ b/Example/HEAnalyticsExampleTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.hsoienterprises.heanalyticssample.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/Example/Podfile b/Example/Podfile new file mode 100644 index 0000000..2db0767 --- /dev/null +++ b/Example/Podfile @@ -0,0 +1,8 @@ +platform :ios, '8.0' +source 'https://github.com/CocoaPods/Specs.git' + +inhibit_all_warnings! + +pod 'GoogleAnalytics-iOS-SDK' +pod 'Mixpanel' +pod 'FlurrySDK' From 6510658eaa0a560160bb9b125f13ff26890f42ef Mon Sep 17 00:00:00 2001 From: "John C. Daub" Date: Thu, 7 May 2015 05:44:04 -0500 Subject: [PATCH 02/10] 'bundle install', and 'pod install' --- Example/Gemfile.lock | 59 +++++++++++++++++ .../project.pbxproj | 63 +++++++++++++++++++ .../contents.xcworkspacedata | 10 +++ Example/Podfile.lock | 24 +++++++ 4 files changed, 156 insertions(+) create mode 100644 Example/Gemfile.lock create mode 100644 Example/HEAnalyticsExample.xcworkspace/contents.xcworkspacedata create mode 100644 Example/Podfile.lock diff --git a/Example/Gemfile.lock b/Example/Gemfile.lock new file mode 100644 index 0000000..e9422bc --- /dev/null +++ b/Example/Gemfile.lock @@ -0,0 +1,59 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (2.3.1) + activesupport (4.2.1) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + claide (0.8.1) + cocoapods (0.36.4) + activesupport (>= 3.2.15) + claide (~> 0.8.1) + cocoapods-core (= 0.36.4) + cocoapods-downloader (~> 0.9.0) + cocoapods-plugins (~> 0.4.1) + cocoapods-trunk (~> 0.6.0) + cocoapods-try (~> 0.4.3) + colored (~> 1.2) + escape (~> 0.0.4) + molinillo (~> 0.2.1) + nap (~> 0.8) + open4 (~> 1.3) + xcodeproj (~> 0.23.1) + cocoapods-core (0.36.4) + activesupport (>= 3.2.15) + fuzzy_match (~> 2.0.4) + nap (~> 0.8.0) + cocoapods-downloader (0.9.0) + cocoapods-plugins (0.4.2) + nap + cocoapods-trunk (0.6.0) + nap (>= 0.8) + netrc (= 0.7.8) + cocoapods-try (0.4.4) + colored (1.2) + escape (0.0.4) + fuzzy_match (2.0.4) + i18n (0.7.0) + json (1.8.2) + minitest (5.6.1) + molinillo (0.2.3) + nap (0.8.0) + netrc (0.7.8) + open4 (1.3.4) + thread_safe (0.3.5) + tzinfo (1.2.2) + thread_safe (~> 0.1) + xcodeproj (0.23.1) + activesupport (>= 3) + colored (~> 1.2) + +PLATFORMS + ruby + +DEPENDENCIES + CFPropertyList (= 2.3.1) + cocoapods (= 0.36.4) diff --git a/Example/HEAnalyticsExample.xcodeproj/project.pbxproj b/Example/HEAnalyticsExample.xcodeproj/project.pbxproj index 71bf60f..aa046f7 100644 --- a/Example/HEAnalyticsExample.xcodeproj/project.pbxproj +++ b/Example/HEAnalyticsExample.xcodeproj/project.pbxproj @@ -14,6 +14,7 @@ 791FBE7A1AFB76F000E3453C /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 791FBE791AFB76F000E3453C /* Images.xcassets */; }; 791FBE7D1AFB76F000E3453C /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 791FBE7B1AFB76F000E3453C /* LaunchScreen.xib */; }; 791FBE891AFB76F000E3453C /* HEAnalyticsExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 791FBE881AFB76F000E3453C /* HEAnalyticsExampleTests.swift */; }; + A38557D5FD85E22805F9A167 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3900659B69E7C5ABD2A12D2 /* libPods.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -27,6 +28,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 3C4DDED3DD9F2A52F9D4EBCC /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; 791FBE6B1AFB76F000E3453C /* HEAnalyticsExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HEAnalyticsExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 791FBE6F1AFB76F000E3453C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 791FBE701AFB76F000E3453C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -38,6 +40,8 @@ 791FBE821AFB76F000E3453C /* HEAnalyticsExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HEAnalyticsExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 791FBE871AFB76F000E3453C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 791FBE881AFB76F000E3453C /* HEAnalyticsExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HEAnalyticsExampleTests.swift; sourceTree = ""; }; + C3900659B69E7C5ABD2A12D2 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; + D1FB6D3D95B4C56DF5DB3762 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -45,6 +49,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + A38557D5FD85E22805F9A167 /* libPods.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -58,12 +63,23 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 585EB69047BCD6B9C2889A51 /* Pods */ = { + isa = PBXGroup; + children = ( + D1FB6D3D95B4C56DF5DB3762 /* Pods.debug.xcconfig */, + 3C4DDED3DD9F2A52F9D4EBCC /* Pods.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; 791FBE621AFB76F000E3453C = { isa = PBXGroup; children = ( 791FBE6D1AFB76F000E3453C /* HEAnalyticsExample */, 791FBE851AFB76F000E3453C /* HEAnalyticsExampleTests */, 791FBE6C1AFB76F000E3453C /* Products */, + 585EB69047BCD6B9C2889A51 /* Pods */, + D952D336F3218A19D4273B4E /* Frameworks */, ); sourceTree = ""; }; @@ -115,6 +131,14 @@ name = "Supporting Files"; sourceTree = ""; }; + D952D336F3218A19D4273B4E /* Frameworks */ = { + isa = PBXGroup; + children = ( + C3900659B69E7C5ABD2A12D2 /* libPods.a */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -122,9 +146,11 @@ isa = PBXNativeTarget; buildConfigurationList = 791FBE8C1AFB76F000E3453C /* Build configuration list for PBXNativeTarget "HEAnalyticsExample" */; buildPhases = ( + E0393E6E471229E03CBD6C30 /* Check Pods Manifest.lock */, 791FBE671AFB76F000E3453C /* Sources */, 791FBE681AFB76F000E3453C /* Frameworks */, 791FBE691AFB76F000E3453C /* Resources */, + 32B7D6E56AEFFD870DE7E27D /* Copy Pods Resources */, ); buildRules = ( ); @@ -210,6 +236,39 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 32B7D6E56AEFFD870DE7E27D /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + E0393E6E471229E03CBD6C30 /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 791FBE671AFB76F000E3453C /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -342,6 +401,7 @@ }; 791FBE8D1AFB76F000E3453C /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = D1FB6D3D95B4C56DF5DB3762 /* Pods.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = HEAnalyticsExample/Info.plist; @@ -352,6 +412,7 @@ }; 791FBE8E1AFB76F000E3453C /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 3C4DDED3DD9F2A52F9D4EBCC /* Pods.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = HEAnalyticsExample/Info.plist; @@ -413,6 +474,7 @@ 791FBE8E1AFB76F000E3453C /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 791FBE8F1AFB76F000E3453C /* Build configuration list for PBXNativeTarget "HEAnalyticsExampleTests" */ = { isa = XCConfigurationList; @@ -421,6 +483,7 @@ 791FBE911AFB76F000E3453C /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/Example/HEAnalyticsExample.xcworkspace/contents.xcworkspacedata b/Example/HEAnalyticsExample.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..c6e8100 --- /dev/null +++ b/Example/HEAnalyticsExample.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Example/Podfile.lock b/Example/Podfile.lock new file mode 100644 index 0000000..77c0f54 --- /dev/null +++ b/Example/Podfile.lock @@ -0,0 +1,24 @@ +PODS: + - FlurrySDK (6.2.0): + - FlurrySDK/FlurrySDK (= 6.2.0) + - FlurrySDK/FlurrySDK (6.2.0) + - GoogleAnalytics-iOS-SDK (3.11): + - GoogleAnalytics-iOS-SDK/Core (= 3.11) + - GoogleAnalytics-iOS-SDK/Core (3.11) + - Mixpanel (2.8.0): + - Mixpanel/Mixpanel (= 2.8.0) + - Mixpanel/Mixpanel (2.8.0): + - Mixpanel/MPCategoryHelpers + - Mixpanel/MPCategoryHelpers (2.8.0) + +DEPENDENCIES: + - FlurrySDK + - GoogleAnalytics-iOS-SDK + - Mixpanel + +SPEC CHECKSUMS: + FlurrySDK: 6d8cc2f898589214ed72e481cf59cffa55b88fe0 + GoogleAnalytics-iOS-SDK: fb15cc7e3d01d06d531653f37443fda90274d53d + Mixpanel: 933b51dd0c7914c80866b3753ef407dce353ebc9 + +COCOAPODS: 0.36.4 From 71e8af89e7419f049782842d688e512669b5622b Mon Sep 17 00:00:00 2001 From: "John C. Daub" Date: Thu, 7 May 2015 05:51:40 -0500 Subject: [PATCH 03/10] Adding HEAnalytics to the project, and a bridging header --- .../project.pbxproj | 45 +++++++++++++++++++ .../HEAnalyticsExample-Bridging-Header.h | 13 ++++++ 2 files changed, 58 insertions(+) create mode 100644 Example/HEAnalyticsExample/HEAnalyticsExample-Bridging-Header.h diff --git a/Example/HEAnalyticsExample.xcodeproj/project.pbxproj b/Example/HEAnalyticsExample.xcodeproj/project.pbxproj index aa046f7..f7a64ac 100644 --- a/Example/HEAnalyticsExample.xcodeproj/project.pbxproj +++ b/Example/HEAnalyticsExample.xcodeproj/project.pbxproj @@ -14,6 +14,14 @@ 791FBE7A1AFB76F000E3453C /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 791FBE791AFB76F000E3453C /* Images.xcassets */; }; 791FBE7D1AFB76F000E3453C /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 791FBE7B1AFB76F000E3453C /* LaunchScreen.xib */; }; 791FBE891AFB76F000E3453C /* HEAnalyticsExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 791FBE881AFB76F000E3453C /* HEAnalyticsExampleTests.swift */; }; + 794B108D1AFB799300D93A51 /* HEAnalytics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794B10851AFB799300D93A51 /* HEAnalytics.swift */; }; + 794B108E1AFB799300D93A51 /* HEAnalyticsData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794B10861AFB799300D93A51 /* HEAnalyticsData.swift */; }; + 794B108F1AFB799300D93A51 /* HEAnalyticsPlatform.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794B10871AFB799300D93A51 /* HEAnalyticsPlatform.swift */; }; + 794B10901AFB799300D93A51 /* HEAnalyticsPlatformFlurry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794B10881AFB799300D93A51 /* HEAnalyticsPlatformFlurry.swift */; }; + 794B10911AFB799300D93A51 /* HEAnalyticsPlatformGAI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794B10891AFB799300D93A51 /* HEAnalyticsPlatformGAI.swift */; }; + 794B10921AFB799300D93A51 /* HEAnalyticsPlatformMixpanel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794B108A1AFB799300D93A51 /* HEAnalyticsPlatformMixpanel.swift */; }; + 794B10931AFB799300D93A51 /* HEJSONHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794B108B1AFB799300D93A51 /* HEJSONHelper.swift */; }; + 794B10941AFB799300D93A51 /* UIViewController+HEAnalytics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794B108C1AFB799300D93A51 /* UIViewController+HEAnalytics.swift */; }; A38557D5FD85E22805F9A167 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3900659B69E7C5ABD2A12D2 /* libPods.a */; }; /* End PBXBuildFile section */ @@ -40,6 +48,15 @@ 791FBE821AFB76F000E3453C /* HEAnalyticsExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HEAnalyticsExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 791FBE871AFB76F000E3453C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 791FBE881AFB76F000E3453C /* HEAnalyticsExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HEAnalyticsExampleTests.swift; sourceTree = ""; }; + 794B10851AFB799300D93A51 /* HEAnalytics.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HEAnalytics.swift; sourceTree = ""; }; + 794B10861AFB799300D93A51 /* HEAnalyticsData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HEAnalyticsData.swift; sourceTree = ""; }; + 794B10871AFB799300D93A51 /* HEAnalyticsPlatform.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HEAnalyticsPlatform.swift; sourceTree = ""; }; + 794B10881AFB799300D93A51 /* HEAnalyticsPlatformFlurry.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HEAnalyticsPlatformFlurry.swift; sourceTree = ""; }; + 794B10891AFB799300D93A51 /* HEAnalyticsPlatformGAI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HEAnalyticsPlatformGAI.swift; sourceTree = ""; }; + 794B108A1AFB799300D93A51 /* HEAnalyticsPlatformMixpanel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HEAnalyticsPlatformMixpanel.swift; sourceTree = ""; }; + 794B108B1AFB799300D93A51 /* HEJSONHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HEJSONHelper.swift; sourceTree = ""; }; + 794B108C1AFB799300D93A51 /* UIViewController+HEAnalytics.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+HEAnalytics.swift"; sourceTree = ""; }; + 794B10951AFB7A4100D93A51 /* HEAnalyticsExample-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "HEAnalyticsExample-Bridging-Header.h"; sourceTree = ""; }; C3900659B69E7C5ABD2A12D2 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; D1FB6D3D95B4C56DF5DB3762 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -75,6 +92,7 @@ 791FBE621AFB76F000E3453C = { isa = PBXGroup; children = ( + 794B10841AFB799300D93A51 /* HEAnalytics */, 791FBE6D1AFB76F000E3453C /* HEAnalyticsExample */, 791FBE851AFB76F000E3453C /* HEAnalyticsExampleTests */, 791FBE6C1AFB76F000E3453C /* Products */, @@ -110,6 +128,7 @@ isa = PBXGroup; children = ( 791FBE6F1AFB76F000E3453C /* Info.plist */, + 794B10951AFB7A4100D93A51 /* HEAnalyticsExample-Bridging-Header.h */, ); name = "Supporting Files"; sourceTree = ""; @@ -131,6 +150,22 @@ name = "Supporting Files"; sourceTree = ""; }; + 794B10841AFB799300D93A51 /* HEAnalytics */ = { + isa = PBXGroup; + children = ( + 794B10851AFB799300D93A51 /* HEAnalytics.swift */, + 794B10861AFB799300D93A51 /* HEAnalyticsData.swift */, + 794B10871AFB799300D93A51 /* HEAnalyticsPlatform.swift */, + 794B10881AFB799300D93A51 /* HEAnalyticsPlatformFlurry.swift */, + 794B10891AFB799300D93A51 /* HEAnalyticsPlatformGAI.swift */, + 794B108A1AFB799300D93A51 /* HEAnalyticsPlatformMixpanel.swift */, + 794B108B1AFB799300D93A51 /* HEJSONHelper.swift */, + 794B108C1AFB799300D93A51 /* UIViewController+HEAnalytics.swift */, + ); + name = HEAnalytics; + path = ../HEAnalytics; + sourceTree = ""; + }; D952D336F3218A19D4273B4E /* Frameworks */ = { isa = PBXGroup; children = ( @@ -275,8 +310,16 @@ buildActionMask = 2147483647; files = ( 791FBE751AFB76F000E3453C /* SecondViewController.swift in Sources */, + 794B10941AFB799300D93A51 /* UIViewController+HEAnalytics.swift in Sources */, + 794B108E1AFB799300D93A51 /* HEAnalyticsData.swift in Sources */, + 794B10911AFB799300D93A51 /* HEAnalyticsPlatformGAI.swift in Sources */, + 794B108D1AFB799300D93A51 /* HEAnalytics.swift in Sources */, + 794B10931AFB799300D93A51 /* HEJSONHelper.swift in Sources */, + 794B10901AFB799300D93A51 /* HEAnalyticsPlatformFlurry.swift in Sources */, 791FBE711AFB76F000E3453C /* AppDelegate.swift in Sources */, + 794B108F1AFB799300D93A51 /* HEAnalyticsPlatform.swift in Sources */, 791FBE731AFB76F000E3453C /* FirstViewController.swift in Sources */, + 794B10921AFB799300D93A51 /* HEAnalyticsPlatformMixpanel.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -407,6 +450,7 @@ INFOPLIST_FILE = HEAnalyticsExample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "HEAnalyticsExample/HEAnalyticsExample-Bridging-Header.h"; }; name = Debug; }; @@ -418,6 +462,7 @@ INFOPLIST_FILE = HEAnalyticsExample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "HEAnalyticsExample/HEAnalyticsExample-Bridging-Header.h"; }; name = Release; }; diff --git a/Example/HEAnalyticsExample/HEAnalyticsExample-Bridging-Header.h b/Example/HEAnalyticsExample/HEAnalyticsExample-Bridging-Header.h new file mode 100644 index 0000000..96cb600 --- /dev/null +++ b/Example/HEAnalyticsExample/HEAnalyticsExample-Bridging-Header.h @@ -0,0 +1,13 @@ +// +// HEAnalyticsExample-Bridging-Header.h +// HEAnalyticsExample +// +// Created by hsoi on 5/7/15. +// Copyright (c) 2015 Hsoi Enterprises LLC. All rights reserved. +// + +#import +#import +#import +#import +#import From a4fb45f8d62db76d159068bf95b7456a3a06515c Mon Sep 17 00:00:00 2001 From: "John C. Daub" Date: Thu, 7 May 2015 05:52:07 -0500 Subject: [PATCH 04/10] Adding imports. --- HEAnalytics/HEAnalyticsPlatform.swift | 1 + HEAnalytics/UIViewController+HEAnalytics.swift | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/HEAnalytics/HEAnalyticsPlatform.swift b/HEAnalytics/HEAnalyticsPlatform.swift index 4cadf77..c2c2ebc 100644 --- a/HEAnalytics/HEAnalyticsPlatform.swift +++ b/HEAnalytics/HEAnalyticsPlatform.swift @@ -33,6 +33,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import Foundation +import UIKit /** HEAnalyticsPlatform provides the base class and structure for implementing an analytics platform's specific API and integrating it into the HEAnalytics framework. diff --git a/HEAnalytics/UIViewController+HEAnalytics.swift b/HEAnalytics/UIViewController+HEAnalytics.swift index 2e8ef56..b4893dc 100644 --- a/HEAnalytics/UIViewController+HEAnalytics.swift +++ b/HEAnalytics/UIViewController+HEAnalytics.swift @@ -32,7 +32,7 @@ // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import Foundation +import UIKit /** HEAnalytic's extension to UIViewController. From c88007b4417775ec194f1ef9e1a62e15fbcbe8a6 Mon Sep 17 00:00:00 2001 From: "John C. Daub" Date: Thu, 7 May 2015 17:15:24 -0500 Subject: [PATCH 05/10] Adjusting some prior Swift 1.2 fixes because some of these things are required, thus IMHO they should fail horribly if violated because something is very wrong and we need to know about it to fix it. --- HEAnalytics/HEAnalyticsPlatformGAI.swift | 5 ++--- HEAnalytics/HEAnalyticsPlatformMixpanel.swift | 5 ++--- HEAnalytics/HEJSONHelper.swift | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/HEAnalytics/HEAnalyticsPlatformGAI.swift b/HEAnalytics/HEAnalyticsPlatformGAI.swift index f34b301..ee42918 100644 --- a/HEAnalytics/HEAnalyticsPlatformGAI.swift +++ b/HEAnalytics/HEAnalyticsPlatformGAI.swift @@ -65,9 +65,8 @@ class HEAnalyticsPlatformGAI: HEAnalyticsPlatform { #endif } - if let trackingID = platformData["trackingID"] as? String { - GAI.sharedInstance().trackerWithTrackingId(trackingID) - } + let trackingID = platformData["trackingID"] as! String + GAI.sharedInstance().trackerWithTrackingId(trackingID) if let dryRun = platformData["dryRun"] as? Bool { GAI.sharedInstance().dryRun = dryRun diff --git a/HEAnalytics/HEAnalyticsPlatformMixpanel.swift b/HEAnalytics/HEAnalyticsPlatformMixpanel.swift index 5bd5020..45af135 100644 --- a/HEAnalytics/HEAnalyticsPlatformMixpanel.swift +++ b/HEAnalytics/HEAnalyticsPlatformMixpanel.swift @@ -57,9 +57,8 @@ class HEAnalyticsPlatformMixpanel: HEAnalyticsPlatform { defaultFlushInterval = flushInterval } - if let token = platformData["token"] as? String { - self.mixpanel = Mixpanel(token: token, launchOptions: nil, andFlushInterval: defaultFlushInterval) - } + let token = platformData["token"] as! String + self.mixpanel = Mixpanel(token: token, launchOptions: nil, andFlushInterval: defaultFlushInterval) if let flushOnBackground = platformData["flushOnBackground"] as? Bool { self.mixpanel.flushOnBackground = flushOnBackground diff --git a/HEAnalytics/HEJSONHelper.swift b/HEAnalytics/HEJSONHelper.swift index c3d75ce..cc85cf5 100644 --- a/HEAnalytics/HEJSONHelper.swift +++ b/HEAnalytics/HEJSONHelper.swift @@ -165,8 +165,8 @@ public class HEJSONHelper: NSObject { var keys = sorted(dictionary.keys) { (obj1, obj2) in - // NOTE: These forced casts should not fail, but if they do, we'll need to find - // another solution. + // Forcing casts because they SHOULD be strings. If they are not, then there's programmer error somewhere + // and we should crash to become aware of whatever the problem is. let s1 = obj1 as! String let s2 = obj2 as! String return s1 < s2 From 69da74b23e0ebbe69c98943730148f1073184f05 Mon Sep 17 00:00:00 2001 From: "John C. Daub" Date: Thu, 7 May 2015 17:17:00 -0500 Subject: [PATCH 06/10] Adjust HEAnalyticsPlatformFlurry for Swift 1.2. Forcing casts because these things should be there, and should fail badly if they aren't what we expect. --- HEAnalytics/HEAnalyticsPlatformFlurry.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/HEAnalytics/HEAnalyticsPlatformFlurry.swift b/HEAnalytics/HEAnalyticsPlatformFlurry.swift index ebbf77f..bb30624 100644 --- a/HEAnalytics/HEAnalyticsPlatformFlurry.swift +++ b/HEAnalytics/HEAnalyticsPlatformFlurry.swift @@ -64,7 +64,7 @@ class HEAnalyticsPlatformFlurry: HEAnalyticsPlatform { Flurry.setAppVersion(self.appVersion()) - let apiKey = platformData["apiKey"] as String + let apiKey = platformData["apiKey"] as! String Flurry.startSession(apiKey) super.initializePlatform(platformData) @@ -79,8 +79,8 @@ class HEAnalyticsPlatformFlurry: HEAnalyticsPlatform { // // If you'd like a different approach, subclass and override. let infoDict = NSBundle.mainBundle().infoDictionary! - let shortVersion = infoDict["CFBundleShortVersionString"] as String - let bundleVersion = infoDict["CFBundleVersion"] as String + let shortVersion = infoDict["CFBundleShortVersionString"] as! String + let bundleVersion = infoDict["CFBundleVersion"] as! String let flurryVersion = shortVersion + "." + bundleVersion return flurryVersion } From cd5edd4873bb5c0591ac36fd69ce5e8d660e226e Mon Sep 17 00:00:00 2001 From: "John C. Daub" Date: Fri, 8 May 2015 05:36:49 -0500 Subject: [PATCH 07/10] Remove singleton sample, since we're Swift 1.2 now and singletons are easy peasy now --- HEAnalytics/HEAnalytics.swift | 9 --------- 1 file changed, 9 deletions(-) diff --git a/HEAnalytics/HEAnalytics.swift b/HEAnalytics/HEAnalytics.swift index f1f10ca..9304f3d 100644 --- a/HEAnalytics/HEAnalytics.swift +++ b/HEAnalytics/HEAnalytics.swift @@ -39,15 +39,6 @@ HEAnalytics provides a base API for logging analytics. */ public class HEAnalytics: NSObject { - /* - class var sharedInstance: HEAnalytics { - struct Static { - static let instance: HEAnalytics = HEAnalytics() - } - return Static.instance - } - */ - override init() { super.init() From 3cab24b11433763e5fba1daa3ebfa9779372ee74 Mon Sep 17 00:00:00 2001 From: "John C. Daub" Date: Fri, 8 May 2015 05:38:50 -0500 Subject: [PATCH 08/10] initialize the tracker up front --- HEAnalytics/HEAnalyticsPlatformGAI.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/HEAnalytics/HEAnalyticsPlatformGAI.swift b/HEAnalytics/HEAnalyticsPlatformGAI.swift index ee42918..7e1b9c9 100644 --- a/HEAnalytics/HEAnalyticsPlatformGAI.swift +++ b/HEAnalytics/HEAnalyticsPlatformGAI.swift @@ -47,6 +47,9 @@ class HEAnalyticsPlatformGAI: HEAnalyticsPlatform { override func initializePlatform(platformData: [NSObject:AnyObject]) { + let trackingID = platformData["trackingID"] as! String + GAI.sharedInstance().trackerWithTrackingId(trackingID) + if let dispatchInterval = platformData["dispatchInterval"] as? NSTimeInterval { GAI.sharedInstance().dispatchInterval = dispatchInterval } @@ -65,9 +68,6 @@ class HEAnalyticsPlatformGAI: HEAnalyticsPlatform { #endif } - let trackingID = platformData["trackingID"] as! String - GAI.sharedInstance().trackerWithTrackingId(trackingID) - if let dryRun = platformData["dryRun"] as? Bool { GAI.sharedInstance().dryRun = dryRun } From 98f69fb11adc8031890ad626bad9b8545a66408e Mon Sep 17 00:00:00 2001 From: "John C. Daub" Date: Fri, 8 May 2015 05:39:20 -0500 Subject: [PATCH 09/10] Flesh out the example with a sample implementation. --- .../project.pbxproj | 19 +++++++++ .../Debug/AnalyticsPlatformConfig.plist | 22 ++++++++++ .../Release/AnalyticsPlatformConfig.plist | 20 +++++++++ Example/HEAnalyticsExample/AppDelegate.swift | 25 ++++++++++- .../BuildScripts/AppBuildPostflight.rb | 42 +++++++++++++++++++ .../HEAnalyticsExample/SampleAnalytics.swift | 29 +++++++++++++ 6 files changed, 155 insertions(+), 2 deletions(-) create mode 100644 Example/HEAnalyticsExample/AnalyticsPlatformConfig/Debug/AnalyticsPlatformConfig.plist create mode 100644 Example/HEAnalyticsExample/AnalyticsPlatformConfig/Release/AnalyticsPlatformConfig.plist create mode 100755 Example/HEAnalyticsExample/BuildScripts/AppBuildPostflight.rb create mode 100644 Example/HEAnalyticsExample/SampleAnalytics.swift diff --git a/Example/HEAnalyticsExample.xcodeproj/project.pbxproj b/Example/HEAnalyticsExample.xcodeproj/project.pbxproj index f7a64ac..939b343 100644 --- a/Example/HEAnalyticsExample.xcodeproj/project.pbxproj +++ b/Example/HEAnalyticsExample.xcodeproj/project.pbxproj @@ -22,6 +22,7 @@ 794B10921AFB799300D93A51 /* HEAnalyticsPlatformMixpanel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794B108A1AFB799300D93A51 /* HEAnalyticsPlatformMixpanel.swift */; }; 794B10931AFB799300D93A51 /* HEJSONHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794B108B1AFB799300D93A51 /* HEJSONHelper.swift */; }; 794B10941AFB799300D93A51 /* UIViewController+HEAnalytics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794B108C1AFB799300D93A51 /* UIViewController+HEAnalytics.swift */; }; + 799860571AFCC5BD00C70A50 /* SampleAnalytics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 799860561AFCC5BD00C70A50 /* SampleAnalytics.swift */; }; A38557D5FD85E22805F9A167 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3900659B69E7C5ABD2A12D2 /* libPods.a */; }; /* End PBXBuildFile section */ @@ -57,6 +58,7 @@ 794B108B1AFB799300D93A51 /* HEJSONHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HEJSONHelper.swift; sourceTree = ""; }; 794B108C1AFB799300D93A51 /* UIViewController+HEAnalytics.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+HEAnalytics.swift"; sourceTree = ""; }; 794B10951AFB7A4100D93A51 /* HEAnalyticsExample-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "HEAnalyticsExample-Bridging-Header.h"; sourceTree = ""; }; + 799860561AFCC5BD00C70A50 /* SampleAnalytics.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SampleAnalytics.swift; sourceTree = ""; }; C3900659B69E7C5ABD2A12D2 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; D1FB6D3D95B4C56DF5DB3762 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -113,6 +115,7 @@ 791FBE6D1AFB76F000E3453C /* HEAnalyticsExample */ = { isa = PBXGroup; children = ( + 799860561AFCC5BD00C70A50 /* SampleAnalytics.swift */, 791FBE701AFB76F000E3453C /* AppDelegate.swift */, 791FBE721AFB76F000E3453C /* FirstViewController.swift */, 791FBE741AFB76F000E3453C /* SecondViewController.swift */, @@ -186,6 +189,7 @@ 791FBE681AFB76F000E3453C /* Frameworks */, 791FBE691AFB76F000E3453C /* Resources */, 32B7D6E56AEFFD870DE7E27D /* Copy Pods Resources */, + 799860551AFCC41300C70A50 /* Run Script - HEAnalytics Config */, ); buildRules = ( ); @@ -287,6 +291,20 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; showEnvVarsInLog = 0; }; + 799860551AFCC41300C70A50 /* Run Script - HEAnalytics Config */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script - HEAnalytics Config"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "script_file=\"AppBuildPostflight.rb\"\n\necho \"Running a custom build phase script: $script_file\"\n${PROJECT_DIR}/HEAnalyticsExample/BuildScripts/${script_file}\nscriptExitStatus=$?\necho \"DONE with script: ${script_file} (exitStatus=${scriptExitStatus})\\n\\n\"\nexit \"${scriptExitStatus}\"\n"; + }; E0393E6E471229E03CBD6C30 /* Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -319,6 +337,7 @@ 791FBE711AFB76F000E3453C /* AppDelegate.swift in Sources */, 794B108F1AFB799300D93A51 /* HEAnalyticsPlatform.swift in Sources */, 791FBE731AFB76F000E3453C /* FirstViewController.swift in Sources */, + 799860571AFCC5BD00C70A50 /* SampleAnalytics.swift in Sources */, 794B10921AFB799300D93A51 /* HEAnalyticsPlatformMixpanel.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Example/HEAnalyticsExample/AnalyticsPlatformConfig/Debug/AnalyticsPlatformConfig.plist b/Example/HEAnalyticsExample/AnalyticsPlatformConfig/Debug/AnalyticsPlatformConfig.plist new file mode 100644 index 0000000..bb4fdda --- /dev/null +++ b/Example/HEAnalyticsExample/AnalyticsPlatformConfig/Debug/AnalyticsPlatformConfig.plist @@ -0,0 +1,22 @@ + + + + + HEAnalyticsPlatformGAI + + trackingID + UA-61735748-3 + dispatchInterval + 10 + logLevel + 4 + + HEAnalyticsPlatformFlurry + + apiKey + P9YDTB5WD6288CH33YP9 + logLevel + 3 + + + diff --git a/Example/HEAnalyticsExample/AnalyticsPlatformConfig/Release/AnalyticsPlatformConfig.plist b/Example/HEAnalyticsExample/AnalyticsPlatformConfig/Release/AnalyticsPlatformConfig.plist new file mode 100644 index 0000000..f5afca8 --- /dev/null +++ b/Example/HEAnalyticsExample/AnalyticsPlatformConfig/Release/AnalyticsPlatformConfig.plist @@ -0,0 +1,20 @@ + + + + + HEAnalyticsPlatformGAI + + trackingID + UA-61735748-3 + dispatchInterval + 15 + + HEAnalyticsPlatformFlurry + + apiKey + P9YDTB5WD6288CH33YP9 + logLevel + 0 + + + diff --git a/Example/HEAnalyticsExample/AppDelegate.swift b/Example/HEAnalyticsExample/AppDelegate.swift index 39b4871..5ec497e 100644 --- a/Example/HEAnalyticsExample/AppDelegate.swift +++ b/Example/HEAnalyticsExample/AppDelegate.swift @@ -13,9 +13,19 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? + + func application(application: UIApplication, willFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool { + SampleAnalytics.sharedInstance.start() + return true + } + func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - // Override point for customization after application launch. + + if let tabController = window?.rootViewController as? UITabBarController { + tabController.delegate = self + } + return true } @@ -41,6 +51,17 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } - } + +extension AppDelegate : UITabBarControllerDelegate { + + func tabBarController(tabBarController: UITabBarController, didSelectViewController viewController: UIViewController) { + if tabBarController.selectedIndex == 0 { + SampleAnalytics.sharedInstance.selectedTab1() + } + else if tabBarController.selectedIndex == 1 { + SampleAnalytics.sharedInstance.selectedTab2() + } + } +} \ No newline at end of file diff --git a/Example/HEAnalyticsExample/BuildScripts/AppBuildPostflight.rb b/Example/HEAnalyticsExample/BuildScripts/AppBuildPostflight.rb new file mode 100755 index 0000000..36368ca --- /dev/null +++ b/Example/HEAnalyticsExample/BuildScripts/AppBuildPostflight.rb @@ -0,0 +1,42 @@ +#!/usr/bin/ruby + +# AppBuildPostflight.rb + +require 'pathname' +require 'fileutils' +require 'rubygems' +require 'cfpropertylist' # gem is actually named "CFPropertyList" + + +built_app_path = Pathname.new(ENV['CONFIGURATION_BUILD_DIR'] + "/" + ENV['EXECUTABLE_NAME'] + ENV['WRAPPER_SUFFIX']) + +### Copy in the AnalyticsPlatformConfig file. + +analyticsplatformconfig_folder_path = Pathname.new(ENV['SRCROOT'] + "/HEAnalyticsExample/AnalyticsPlatformConfig/" + ENV['CONFIGURATION']) +configplist_file_path = Pathname.new(analyticsplatformconfig_folder_path + "AnalyticsPlatformConfig.plist") +FileUtils.cp_r File.expand_path(configplist_file_path), built_app_path + + +### Massage the Info.plist. +# We do this here because the Info.plist that's actually in the project file isn't directly used by Xcode, but +# rather Xcode uses it as the basis for the end Info.plist, but also inserts a bunch of other things +# in there during the build process. What we need to do is come in after the fact an modify the generated +# Info.plist. + +# Get the git version hash that we're building from, so we can insert it into the Info.plist. +gitver = `git rev-parse --short HEAD`.strip + +info_plist_file_path = Pathname.new(built_app_path + "Info.plist") +info_plist = CFPropertyList::List.new(:file => info_plist_file_path) + +#plist_additions_file_path = Pathname.new(ENV['SRCROOT'] + "/BuildResources/Common/InfoPlistAdditions.plist") +#plist_additions = CFPropertyList::List.new(:file => plist_additions_file_path.to_s) +#plist_additions_native = CFPropertyList.native_types(plist_additions.value) + +#plist_additions_native.each do | key, value | +# info_plist.value.value[key] = CFPropertyList.guess(value) +#end + +info_plist.value.value['HESourceVersion'] = CFPropertyList::CFString.new(gitver) + +info_plist.save(info_plist_file_path, CFPropertyList::List::FORMAT_BINARY) diff --git a/Example/HEAnalyticsExample/SampleAnalytics.swift b/Example/HEAnalyticsExample/SampleAnalytics.swift new file mode 100644 index 0000000..2684bb0 --- /dev/null +++ b/Example/HEAnalyticsExample/SampleAnalytics.swift @@ -0,0 +1,29 @@ +// +// SampleAnalytics.swift +// HEAnalyticsExample +// +// Created by hsoi on 5/8/15. +// Copyright (c) 2015 Hsoi Enterprises LLC. All rights reserved. +// + +import Foundation + +/** SampleAnalytics Class + +*/ +class SampleAnalytics : HEAnalytics { + + static let sharedInstance = SampleAnalytics() + + + func selectedTab1() { + let data = HEAnalyticsData(category: .View, event: "Selected Tab 1") + self.trackData(data) + } + + func selectedTab2() { + let data = HEAnalyticsData(category: .View, event: "Selected Tab 2") + self.trackData(data) + } + +} From d7d2983de78648d71723519680ed5465383805fc Mon Sep 17 00:00:00 2001 From: "John C. Daub" Date: Fri, 8 May 2015 05:42:01 -0500 Subject: [PATCH 10/10] Updating readme --- README.md | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 9e3e89f..ddf8198 100644 --- a/README.md +++ b/README.md @@ -35,14 +35,12 @@ It enables logic for converting the data-to-track into something the analytics A Developed with -- Xcode 6.2 -- Swift 1.1 +- Xcode 6.4 beta 2 (should work with Xcode 6.3.1) +- Swift 1.2 - iOS 8 It should work with iOS 7, but has not been extensively tested. -Swift 1.2 support is planned. - No effort has been made to make this work on Mac OS X, and there are presently no plans to do so. @@ -98,12 +96,7 @@ Second, `HEAnalytics` aims to provide a unified abstraction layer for analytics Code would look something like this: class MyAppAnalytics: HEAnalytics { - class var sharedInstance: MyAppAnalytics { - struct Static { - static let instance: MyAppAnalytics = MyAppAnalytics() - } - return Static.instance - } + static let sharedInstance = MyAppAnalytics() func trackSliderValue(value: Float) { let parameters = ["value": value]