Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #34 from NIOSH-Roger/master
Browse files Browse the repository at this point in the history
Swift 3 conversion to Xcode 8.3, add upgrade message pointing to OSHA…
  • Loading branch information
giridhar authored May 31, 2017
2 parents c3e81c6 + 4488192 commit b5a7f14
Show file tree
Hide file tree
Showing 10 changed files with 192 additions and 170 deletions.
26 changes: 15 additions & 11 deletions Heat Tool.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -383,12 +383,12 @@
TargetAttributes = {
83FDDFD31A66C9470018A068 = {
CreatedOnToolsVersion = 6.1.1;
DevelopmentTeam = FRPCGFXS7Q;
LastSwiftMigration = 0810;
LastSwiftMigration = 0830;
ProvisioningStyle = Automatic;
};
83FDDFE81A66C9470018A068 = {
CreatedOnToolsVersion = 6.1.1;
LastSwiftMigration = 0810;
LastSwiftMigration = 0830;
TestTargetID = 83FDDFD31A66C9470018A068;
};
};
Expand Down Expand Up @@ -729,19 +729,21 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "Heat Tool/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
);
PRODUCT_BUNDLE_IDENTIFIER = "gov.osha.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = gov.dol.heatapp;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Heat Tool-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -752,18 +754,20 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "Heat Tool/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
);
PRODUCT_BUNDLE_IDENTIFIER = "gov.osha.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = gov.dol.heatapp;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Heat Tool-Bridging-Header.h";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand All @@ -783,7 +787,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "gov.osha.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Heat Tool.app/Heat Tool";
};
name = Debug;
Expand All @@ -799,7 +803,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "gov.osha.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Heat Tool.app/Heat Tool";
};
name = Release;
Expand Down
18 changes: 9 additions & 9 deletions Heat Tool/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,48 +16,48 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var myHeatIndexController:HeatIndexController?


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.

// Init Google Analytics
GAI.sharedInstance().trackUncaughtExceptions = true
GAI.sharedInstance().dispatchInterval = 20
// GAI.sharedInstance().logger.logLevel = GAILogLevel.Verbose
GAI.sharedInstance().trackerWithTrackingId("UA-61504244-1").set(kGAIAnonymizeIp, value: "1")
GAI.sharedInstance().tracker(withTrackingId: "UA-61504244-1").set(kGAIAnonymizeIp, value: "1")

return true
}

func applicationWillResignActive(application: UIApplication) {
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) {
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) {
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.

// If the app was in geolocation mode
if myHeatIndexController?.usingUsersLocation == true && CLLocationManager.authorizationStatus() == CLAuthorizationStatus.AuthorizedWhenInUse {
if myHeatIndexController?.usingUsersLocation == true && CLLocationManager.authorizationStatus() == CLAuthorizationStatus.authorizedWhenInUse {
// Record GA event
let tracker = GAI.sharedInstance().defaultTracker
tracker.send(GAIDictionaryBuilder.createEventWithCategory("app", action: "bring-app-to-foreground", label: "get-current-conditions", value: nil).build() as [NSObject : AnyObject])
tracker?.send(GAIDictionaryBuilder.createEvent(withCategory: "app", action: "bring-app-to-foreground", label: "get-current-conditions", value: nil).build() as! [AnyHashable: Any])

// Get the latest data
myHeatIndexController?.locationActivityIndicator.startAnimating()
myHeatIndexController?.locManager.startUpdatingLocation()
}
}

func applicationDidBecomeActive(application: UIApplication) {
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) {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

Expand Down
Binary file modified Heat Tool/Base.lproj/Localizable.strings
Binary file not shown.
Loading

0 comments on commit b5a7f14

Please sign in to comment.