diff --git a/Gulps WatchKit App/Info.plist b/Gulps WatchKit App/Info.plist index 044db32..08a5618 100644 --- a/Gulps WatchKit App/Info.plist +++ b/Gulps WatchKit App/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.3 + 1.4 CFBundleSignature ???? CFBundleVersion - 12 + 13 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait diff --git a/Gulps WatchKit Extension/Info.plist b/Gulps WatchKit Extension/Info.plist index a016a7b..a07a705 100644 --- a/Gulps WatchKit Extension/Info.plist +++ b/Gulps WatchKit Extension/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 1.3 + 1.4 CFBundleSignature ???? CFBundleVersion - 12 + 13 NSExtension NSExtensionAttributes diff --git a/Gulps/AppDelegate.swift b/Gulps/AppDelegate.swift index 25ad2b5..10832b7 100644 --- a/Gulps/AppDelegate.swift +++ b/Gulps/AppDelegate.swift @@ -1,5 +1,4 @@ - import UIKit -import DPMeterView +import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { @@ -10,9 +9,34 @@ class AppDelegate: UIResponder, UIApplicationDelegate { EntryHandler.bootstrapRealm() - DPMeterView.appearance().trackTintColor = .lightGray() - DPMeterView.appearance().progressTintColor = .mainColor() + setupAppearance() + Settings.registerDefaults() + + let userDefaults = NSUserDefaults.groupUserDefaults() + if (!userDefaults.boolForKey(Settings.General.OnboardingShown.key())) { + loadOnboardingInterface() + } else { + loadMainInterface() + checkVersion() + } + + return true + } + + func checkVersion() { + let userDefaults = NSUserDefaults.groupUserDefaults() + let current = userDefaults.integerForKey("BUNDLE_VERSION") + if let versionString = NSBundle.mainBundle().infoDictionary?["CFBundleVersion"] as? String, let version = versionString.toInt() { + if current < 13 { + NotificationHelper.rescheduleNotifications() + } + userDefaults.setInteger(version, forKey: "BUNDLE_VERSION") + userDefaults.synchronize() + } + } + + func setupAppearance() { Globals.actionSheetAppearance() UITabBar.appearance().tintColor = .mainColor() @@ -24,17 +48,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { UINavigationBar.appearance().barTintColor = .mainColor() UINavigationBar.appearance().tintColor = .whiteColor() - - Settings.registerDefaults() - - let userDefaults = NSUserDefaults.groupUserDefaults() - if (!userDefaults.boolForKey(Settings.General.OnboardingShown.key())) { - loadOnboardingInterface() - } else { - loadMainInterface() - } - - return true } func loadOnboardingInterface() { diff --git a/Gulps/Info.plist b/Gulps/Info.plist index 37a6e85..8601c62 100644 --- a/Gulps/Info.plist +++ b/Gulps/Info.plist @@ -15,11 +15,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.3 + 1.4 CFBundleSignature ???? CFBundleVersion - 12 + 13 LSRequiresIPhoneOS UIAppFonts diff --git a/Gulps/Support/NotificationHelper.swift b/Gulps/Support/NotificationHelper.swift index 9d0e8bd..d96c845 100644 --- a/Gulps/Support/NotificationHelper.swift +++ b/Gulps/Support/NotificationHelper.swift @@ -3,6 +3,16 @@ import UIKit class NotificationHelper { + /// Version 1.4 introduces a new sound. Users from previous versions need to reschedule the local notifications + class func rescheduleNotifications() { + let userDefaults = NSUserDefaults.groupUserDefaults() + if (!userDefaults.boolForKey(Settings.Notification.On.key())) { + return + } + unscheduleNotifications() + registerNotifications() + } + class func registerNotifications() { let userDefaults = NSUserDefaults.groupUserDefaults() if (!userDefaults.boolForKey(Settings.Notification.On.key())) { diff --git a/GulpsToday/Info.plist b/GulpsToday/Info.plist index 360f0e8..bc3c9ac 100644 --- a/GulpsToday/Info.plist +++ b/GulpsToday/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 1.3 + 1.4 CFBundleSignature ???? CFBundleVersion - 12 + 13 NSExtension NSExtensionMainStoryboard diff --git a/Podfile b/Podfile index 28e8cdf..6b14dc3 100644 --- a/Podfile +++ b/Podfile @@ -9,7 +9,7 @@ def common_pods pod 'AMPopTip', '~> 0.7' pod 'UICountingLabel', '~> 1.2' pod 'JTCalendar', git: 'https://github.com/andreamazz/JTCalendar', branch: 'develop' - pod 'BAFluidView', git: 'https://github.com/antiguab/BAFluidView', branch: '0.1.5' + pod 'BAFluidView', '~> 0.1.5' pod 'BubbleTransition' # pod 'BEMSimpleLineGraph' end