Skip to content

Commit df117a7

Browse files
committed
Merge pull request #26 from someoneAnyone/dev
Updating to current Test Flight Release
2 parents 5a14c19 + 5c44b45 commit df117a7

File tree

8 files changed

+101
-38
lines changed

8 files changed

+101
-38
lines changed

.travis.yml

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
language: objective-c
2-
3-
branches:
4-
only:
5-
- master
6-
7-
osx_image: xcode7
1+
language: objective-c

Nightscouter/AppDelegate.swift

+4-3
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
106106

107107
completionHandler(.NewData)
108108
}
109-
110-
func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {
109+
110+
func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
111111
print(">>> Entering \(__FUNCTION__) <<<")
112-
print("Recieved URL: \(url) from sourceApplication: \(sourceApplication) annotation: \(annotation))")
112+
113+
print("Recieved URL: \(url) with options: \(options)")
113114

114115
let schemes = AppDataManager.sharedInstance.supportedSchemes!
115116
if (!schemes.contains((url.scheme))) { // If the incoming scheme is not contained within the array of supported schemes return false.

Nightscouter/Base.lproj/Main.storyboard

+55-20
Large diffs are not rendered by default.

Nightscouter/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</dict>
3333
</array>
3434
<key>CFBundleVersion</key>
35-
<string>135</string>
35+
<string>138</string>
3636
<key>LSRequiresIPhoneOS</key>
3737
<true/>
3838
<key>NSUserActivityTypes</key>

Nightscouter/SiteDetailViewController.swift

+21-4
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,8 @@ extension SiteDetailViewController {
257257

258258
@IBAction func gotoSiteSettings(sender: UIBarButtonItem) {
259259

260-
let alertController = UIAlertController(title: Constants.LocalizedString.uiAlertScreenOverrideTitle.localized, message: Constants.LocalizedString.uiAlertScreenOverrideMessage.localized, preferredStyle: UIAlertControllerStyle.ActionSheet)
260+
let alertController = UIAlertController(title: Constants.LocalizedString.uiAlertScreenOverrideTitle.localized, message: Constants.LocalizedString.uiAlertScreenOverrideMessage.localized, preferredStyle: .ActionSheet)
261261

262-
alertController.view.tintColor = NSAssetKit.darkNavColor
263262

264263
let cancelAction = UIAlertAction(title: Constants.LocalizedString.generalCancelLabel.localized, style: .Cancel) { (action) in
265264
#if DEBUG
@@ -273,26 +272,44 @@ extension SiteDetailViewController {
273272
if site!.overrideScreenLock == true {
274273
yesString = checkEmoji
275274
}
276-
let yesAction = UIAlertAction(title: "\(yesString)\(Constants.LocalizedString.generalYesLabel.localized)", style: UIAlertActionStyle.Default) { (action) -> Void in
275+
276+
let yesAction = UIAlertAction(title: "\(yesString)\(Constants.LocalizedString.generalYesLabel.localized)", style: .Default) { (action) -> Void in
277277
self.updateScreenOverride(true)
278278
#if DEBUG
279279
print("Yes action: \(action)")
280280
#endif
281281
}
282+
282283
alertController.addAction(yesAction)
284+
285+
if #available(iOS 9.0, *) {
286+
alertController.preferredAction = yesAction
287+
}
288+
283289

284290
var noString = " "
285291
if (site!.overrideScreenLock == false) {
286292
noString = checkEmoji
287293
}
288-
let noAction = UIAlertAction(title: "\(noString)\(Constants.LocalizedString.generalNoLabel.localized)", style: UIAlertActionStyle.Default) { (action) -> Void in
294+
295+
let noAction = UIAlertAction(title: "\(noString)\(Constants.LocalizedString.generalNoLabel.localized)", style: .Destructive) { (action) -> Void in
289296
self.updateScreenOverride(false)
290297
#if DEBUG
291298
print("No action: \(action)")
292299
#endif
293300
}
294301
alertController.addAction(noAction)
302+
303+
alertController.view.tintColor = NSAssetKit.darkNavColor
295304

305+
self.view.window?.tintColor = nil
306+
307+
// Resolving Incident with Identifier: 1169918A-77AC-4D15-8610-E62C1D74E386
308+
// Crash in UIPopoverPresentationController
309+
if let popoverController = alertController.popoverPresentationController {
310+
popoverController.barButtonItem = sender
311+
}
312+
296313
self.presentViewController(alertController, animated: true) {
297314
#if DEBUG
298315
print("presentViewController: \(alertController.debugDescription)")

Nightscouter/SiteListTableViewController.swift

+4-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,6 @@ class SiteListTableViewController: UITableViewController, NightscoutAPIClientDel
381381
func presentAlertDialog(siteURL:NSURL, index: Int, error: NSError) {
382382

383383
let alertController = UIAlertController(title: Constants.LocalizedString.uiAlertBadSiteTitle.localized, message: String(format: Constants.LocalizedString.uiAlertBadSiteMessage.localized, siteURL, error.localizedDescription), preferredStyle: .Alert)
384-
alertController.view.tintColor = NSAssetKit.darkNavColor
385384

386385
let cancelAction = UIAlertAction(title: Constants.LocalizedString.generalCancelLabel.localized, style: .Cancel) { (action) in
387386
// ...
@@ -414,6 +413,10 @@ class SiteListTableViewController: UITableViewController, NightscoutAPIClientDel
414413
}
415414
alertController.addAction(removeAction)
416415

416+
alertController.view.tintColor = NSAssetKit.darkNavColor
417+
418+
self.view.window?.tintColor = nil
419+
417420
self.navigationController?.popToRootViewControllerAnimated(true)
418421

419422
self.presentViewController(alertController, animated: true) {

NightscouterKit/Models/ServerConfiguration.swift

+14-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,20 @@ public extension ServerConfiguration {
311311

312312
if let settingsDictionary = root[ConfigurationPropertyKey.settingsKey] as? [String: AnyObject] {
313313
let units = Units(rawValue: (settingsDictionary[ConfigurationPropertyKey.unitsKey] as! String).lowercaseString)!
314-
let timeFormat = Int((settingsDictionary[ConfigurationPropertyKey.timeFormatKey] as! String))!
314+
315+
316+
var timeFormat: Int = 12
317+
318+
if let stringTimeFormat = settingsDictionary[ConfigurationPropertyKey.timeFormatKey] as? String {
319+
timeFormat = Int(stringTimeFormat)!
320+
}
321+
322+
323+
if let intTimeFormat = settingsDictionary[ConfigurationPropertyKey.timeFormatKey] as? Int {
324+
timeFormat = intTimeFormat
325+
}
326+
327+
315328
let nightMode = settingsDictionary[ConfigurationPropertyKey.nightModeKey] as! Bool
316329
let showRawbg = RawBGMode(rawValue: settingsDictionary[ConfigurationPropertyKey.showRawbgKey] as! String)!
317330
let customTitle = settingsDictionary[ConfigurationPropertyKey.customTitleKey] as! String

NightscouterToday/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>135</string>
24+
<string>138</string>
2525
<key>NSExtension</key>
2626
<dict>
2727
<key>NSExtensionMainStoryboard</key>

0 commit comments

Comments
 (0)