-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detail view wasn't updating correctly.
- Loading branch information
1 parent
a4d6616
commit 414c4f4
Showing
9 changed files
with
141 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// | ||
// Protocols.swift | ||
// Nightscouter | ||
// | ||
// Created by Peter Ina on 3/10/16. | ||
// Copyright © 2016 Peter Ina. All rights reserved. | ||
// | ||
|
||
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
Shared Framework Code/Protocols/UpdatableUserInterfaceType.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// UpdatableUserInterfaceType.swift | ||
// Nightscouter | ||
// | ||
// Created by Peter Ina on 3/10/16. | ||
// Copyright © 2016 Peter Ina. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
|
||
#if os(iOS) | ||
import UIKit | ||
public typealias ViewController = UIViewController | ||
#elseif os(watchOS) | ||
import WatchKit | ||
public typealias ViewController = WKInterfaceController | ||
#elseif os(OSX) | ||
import Cocoa | ||
public typealias ViewController = NSViewController | ||
#endif | ||
|
||
public protocol UpdatableUserInterfaceType { | ||
func startUpdateUITimer() | ||
var updateInterval: NSTimeInterval { get } | ||
func updateUI(notif: NSTimer) | ||
} | ||
|
||
public extension UpdatableUserInterfaceType where Self: ViewController { | ||
|
||
var updateUITimer: NSTimer { | ||
return NSTimer.scheduledTimerWithTimeInterval(updateInterval, target: self, selector: Selector("updateUI:"), userInfo: nil, repeats: true) | ||
} | ||
|
||
func startUpdateUITimer() { | ||
print(updateUITimer) | ||
} | ||
|
||
var updateInterval: NSTimeInterval { | ||
return 60.0 | ||
} | ||
} | ||
|
||
|