Skip to content

Commit

Permalink
Merge pull request #150 from iglance/release/v2.0.6
Browse files Browse the repository at this point in the history
Release/v2.0.6
  • Loading branch information
D0miH authored Apr 20, 2020
2 parents 23490e4 + 33cfd5e commit a422dbc
Show file tree
Hide file tree
Showing 20 changed files with 238 additions and 81 deletions.
17 changes: 17 additions & 0 deletions Sparkle/updates/appcast.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,22 @@
<enclosure url="https://github.com/raw/iglance/iGlance/master/Sparkle/updates/iGlance2.0.5-2.0.delta" sparkle:version="2.0.5" sparkle:shortVersionString="2.0.5" sparkle:deltaFrom="2.0" length="290608" type="application/octet-stream" sparkle:edSignature="Eb1VYiXtHgA4TYFNA6y6HB2EuEnz+LrL3MgdUS2zU4oFzhM2UqKxDMZq7W+if6BSOIKjLlI7y3MrcAKdLVsQAw=="/>
</sparkle:deltas>
</item>
<item>
<title>2.0.6</title>
<sparkle:releaseNotesLink>
https://iglance.github.io/release-notes.html
</sparkle:releaseNotesLink>
<pubDate>Mon, 20 Apr 2020 19:00:38 +0200</pubDate>
<sparkle:minimumSystemVersion>10.12</sparkle:minimumSystemVersion>
<enclosure url="https://github.com/iglance/iGlance/releases/download/v2.0.6/iGlance_v2.0.6.zip" sparkle:version="2.0.6" sparkle:shortVersionString="2.0.6" length="10119751" type="application/octet-stream" sparkle:edSignature="GsXCjr/m+gb0Xq8SZQrtfs8ZbPSgEKlSYXCdz21fWQOHgSvF0JXeCmz+U+avxG7wPeqpoFv7DHCkj/9fV45AAg=="/>
<sparkle:deltas>
<enclosure url="https://github.com/raw/iglance/iGlance/master/Sparkle/updates/iGlance2.0.6-2.0.5.delta" sparkle:version="2.0.6" sparkle:shortVersionString="2.0.6" sparkle:deltaFrom="2.0.5" length="181492" type="application/octet-stream" sparkle:edSignature="mraUX3nfdYAynYTzjor8haxSYsbWIBk+/89n6gWVspiC3ClYqOrT2SgIa/x9OMuMNa5jiDgwIeWEQIR5cD1HBA=="/>
<enclosure url="https://github.com/raw/iglance/iGlance/master/Sparkle/updates/iGlance2.0.6-2.0.4.delta" sparkle:version="2.0.6" sparkle:shortVersionString="2.0.6" sparkle:deltaFrom="2.0.4" length="207092" type="application/octet-stream" sparkle:edSignature="PlSkE0bGzBv3VpEhJoLqBMuGJqRlxvwLkOhSxBRAydCm6k3ei61jk8NdLMLEUVmr/GGaGCF4tJrzJicPstrACw=="/>
<enclosure url="https://github.com/raw/iglance/iGlance/master/Sparkle/updates/iGlance2.0.6-2.0.3.delta" sparkle:version="2.0.6" sparkle:shortVersionString="2.0.6" sparkle:deltaFrom="2.0.3" length="295480" type="application/octet-stream" sparkle:edSignature="PPKQa1wbmKoVxCCjSb9vFJzxZEXli1CbswT4JNFTIIXgeA97RlT8pFLC2s+AsBuq2/PEnHXYQADjERFqp2pCAA=="/>
<enclosure url="https://github.com/raw/iglance/iGlance/master/Sparkle/updates/iGlance2.0.6-2.0.2.delta" sparkle:version="2.0.6" sparkle:shortVersionString="2.0.6" sparkle:deltaFrom="2.0.2" length="318293" type="application/octet-stream" sparkle:edSignature="0sd0Uj3XPcXq5tuHcv6Q6D7RG+BVijJdiHIH5vBJRvhd4bDOc7KdIT1isU7/jPMz5PHI/3ehgrmFBAc3hNNXAg=="/>
<enclosure url="https://github.com/raw/iglance/iGlance/master/Sparkle/updates/iGlance2.0.6-2.0.1.delta" sparkle:version="2.0.6" sparkle:shortVersionString="2.0.6" sparkle:deltaFrom="2.0.1" length="309102" type="application/octet-stream" sparkle:edSignature="r9qU62dcmLqIZibRxlgUCV7GrirY14sQ+u0YsmN20FjfPAWfTFLCSZ+17D8kadK8cv+fhV7YUk+bqs0TcAkSDw=="/>
<enclosure url="https://github.com/raw/iglance/iGlance/master/Sparkle/updates/iGlance2.0.6-2.0.delta" sparkle:version="2.0.6" sparkle:shortVersionString="2.0.6" sparkle:deltaFrom="2.0" length="315802" type="application/octet-stream" sparkle:edSignature="4x2uEUfhnNhJv0OqaQLuQ54GxLRpCSjnvj8pCM5YbxbSMvjeyinU8h+jxe1PEY3S9JX9ZI5EEqfRPP6O4OONBw=="/>
</sparkle:deltas>
</item>
</channel>
</rss>
Binary file added Sparkle/updates/iGlance2.0.6-2.0.1.delta
Binary file not shown.
Binary file added Sparkle/updates/iGlance2.0.6-2.0.2.delta
Binary file not shown.
Binary file added Sparkle/updates/iGlance2.0.6-2.0.3.delta
Binary file not shown.
Binary file added Sparkle/updates/iGlance2.0.6-2.0.4.delta
Binary file not shown.
Binary file added Sparkle/updates/iGlance2.0.6-2.0.5.delta
Binary file not shown.
Binary file added Sparkle/updates/iGlance2.0.6-2.0.delta
Binary file not shown.
16 changes: 12 additions & 4 deletions iGlance/iGlance/iGlance.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
B472EC20243101DB002F7504 /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = B472EC1F243101DB002F7504 /* Logger.swift */; };
B47D3C8D23ABEDF100DE911F /* CustomDashboardBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = B47D3C8C23ABEDF100DE911F /* CustomDashboardBox.swift */; };
B48BD19123E73F8E00152931 /* CpuUsageMenuBarItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = B48BD19023E73F8E00152931 /* CpuUsageMenuBarItem.swift */; };
B4924F09244A2492000D8BDD /* RepeatingTimer.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4924F08244A2492000D8BDD /* RepeatingTimer.swift */; };
B49CD58F23EB17D9009711E6 /* CodableColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = B49CD58E23EB17D9009711E6 /* CodableColor.swift */; };
B49CDFF523E1E18A0070D664 /* AppMover.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B49CDFF223E1DB9B0070D664 /* AppMover.framework */; };
B49CDFF623E1E18A0070D664 /* AppMover.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B49CDFF223E1DB9B0070D664 /* AppMover.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
Expand All @@ -61,6 +62,7 @@
B4C37E6D23A8D811008C7FC0 /* ContentManagerViewControllerHolder.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4C37E6C23A8D811008C7FC0 /* ContentManagerViewControllerHolder.swift */; };
B4C37E7023A91F3C008C7FC0 /* ThemeManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4C37E6F23A91F3C008C7FC0 /* ThemeManager.swift */; };
B4C8DD2523AA3DB8008DAE45 /* ContentManagerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4C8DD2423AA3DB8008DAE45 /* ContentManagerView.swift */; };
B4C985E3244CB694002F8D3F /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4C985E2244CB694002F8D3F /* Utils.swift */; };
B4CF2F7823C4F5CD00544511 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4CF2F7723C4F5CD00544511 /* AppDelegate.swift */; };
B4CF2F7C23C4F5CE00544511 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B4CF2F7B23C4F5CE00544511 /* Assets.xcassets */; };
B4CF2F7F23C4F5CE00544511 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B4CF2F7D23C4F5CE00544511 /* Main.storyboard */; };
Expand Down Expand Up @@ -161,6 +163,7 @@
B472EC1F243101DB002F7504 /* Logger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Logger.swift; sourceTree = "<group>"; };
B47D3C8C23ABEDF100DE911F /* CustomDashboardBox.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomDashboardBox.swift; sourceTree = "<group>"; };
B48BD19023E73F8E00152931 /* CpuUsageMenuBarItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CpuUsageMenuBarItem.swift; sourceTree = "<group>"; };
B4924F08244A2492000D8BDD /* RepeatingTimer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RepeatingTimer.swift; sourceTree = "<group>"; };
B49CD58E23EB17D9009711E6 /* CodableColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableColor.swift; sourceTree = "<group>"; };
B49CDFF223E1DB9B0070D664 /* AppMover.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = AppMover.framework; sourceTree = BUILT_PRODUCTS_DIR; };
B49CDFF723E1E1950070D664 /* SMCKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SMCKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand All @@ -176,6 +179,7 @@
B4C37E6C23A8D811008C7FC0 /* ContentManagerViewControllerHolder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentManagerViewControllerHolder.swift; sourceTree = "<group>"; };
B4C37E6F23A91F3C008C7FC0 /* ThemeManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemeManager.swift; sourceTree = "<group>"; };
B4C8DD2423AA3DB8008DAE45 /* ContentManagerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentManagerView.swift; sourceTree = "<group>"; };
B4C985E2244CB694002F8D3F /* Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = "<group>"; };
B4CF2F7523C4F5CD00544511 /* iGlanceLauncher.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iGlanceLauncher.app; sourceTree = BUILT_PRODUCTS_DIR; };
B4CF2F7723C4F5CD00544511 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
B4CF2F7B23C4F5CE00544511 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand Down Expand Up @@ -305,6 +309,7 @@
B4DE727F23C2644A0001CF46 /* BatteryInfo.swift */,
B415FF2B23F45F6000ED6567 /* MemoryInfo.swift */,
B4F4AF3A23FAFBD60033B5CE /* FanInfo.swift */,
B4C985E2244CB694002F8D3F /* Utils.swift */,
);
path = SystemInfo;
sourceTree = "<group>";
Expand Down Expand Up @@ -392,6 +397,7 @@
B4C37E6E23A91F2F008C7FC0 /* Theme */,
B4FE0DAD23EF1BCB00AE94E6 /* Utils */,
B46789B523A69ECA00CE572D /* AppDelegate.swift */,
B4924F08244A2492000D8BDD /* RepeatingTimer.swift */,
B472EC1F243101DB002F7504 /* Logger.swift */,
B4DE725E23C257610001CF46 /* Extensions.swift */,
B49F5D5623C5BCAF009E9BE6 /* UserSettings.swift */,
Expand Down Expand Up @@ -718,9 +724,11 @@
B4E909112427B33F00260479 /* BatteryMenuBarItem.swift in Sources */,
B4C37E6D23A8D811008C7FC0 /* ContentManagerViewControllerHolder.swift in Sources */,
B48BD19123E73F8E00152931 /* CpuUsageMenuBarItem.swift in Sources */,
B4C985E3244CB694002F8D3F /* Utils.swift in Sources */,
B4CFC47623FC393300A0ED15 /* FanViewController.swift in Sources */,
B4A0D37A242E5FD500690098 /* NetworkStatisticsMenuView.swift in Sources */,
B4E909132427B5EA00260479 /* BatteryViewController.swift in Sources */,
B4924F09244A2492000D8BDD /* RepeatingTimer.swift in Sources */,
B4FE0DB123EF1E0100AE94E6 /* LineGraph.swift in Sources */,
B4FE0DB323EF210500AE94E6 /* Graph.swift in Sources */,
B43ABF2A23AA32FA007F93BA /* SidebarViewController.swift in Sources */,
Expand Down Expand Up @@ -908,7 +916,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2.0.5;
CURRENT_PROJECT_VERSION = 2.0.6;
DEVELOPMENT_TEAM = J6GXEPK4NG;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = iGlance/Info.plist;
Expand All @@ -917,7 +925,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 2.0.5;
MARKETING_VERSION = 2.0.6;
PRODUCT_BUNDLE_IDENTIFIER = io.github.iglance.iGlance;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -935,7 +943,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2.0.5;
CURRENT_PROJECT_VERSION = 2.0.6;
DEVELOPMENT_TEAM = J6GXEPK4NG;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = iGlance/Info.plist;
Expand All @@ -944,7 +952,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 2.0.5;
MARKETING_VERSION = 2.0.6;
PRODUCT_BUNDLE_IDENTIFIER = io.github.iglance.iGlance;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
33 changes: 16 additions & 17 deletions iGlance/iGlance/iGlance/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {

var mainWindow: MainWindowController = NSStoryboard(name: "Main", bundle: nil).instantiateController(withIdentifier: "MainWindowController") as! MainWindowController

var currentUpdateLoopTimer: Timer!
var currentUpdateLoopTimer: RepeatingTimer!

// MARK: -
// MARK: Lifecycle Functions
Expand Down Expand Up @@ -92,8 +92,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
*/
@objc
private func onWakeUp(notification: NSNotification) {
// invalidate the old timer and start a new timer
changeUpdateLoopTimeInterval(interval: AppDelegate.userSettings.settings.updateInterval)
// resume the timer
currentUpdateLoopTimer.resume()
DDLogInfo("Create a new timer after waking up from sleep")
}

Expand All @@ -102,8 +102,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
*/
@objc
private func onSleep(notification: NSNotification) {
// invalidate currently used timer
currentUpdateLoopTimer.invalidate()
// suspend the current timer
currentUpdateLoopTimer.suspend()
DDLogInfo("Invalidated the current timer")
}

Expand Down Expand Up @@ -214,32 +214,31 @@ class AppDelegate: NSObject, NSApplicationDelegate {
*
* - Returns: The newly created timer.
*/
func createUpdateLoopTimer(interval: Double) -> Timer {
let timer = Timer.scheduledTimer(timeInterval: interval, target: self, selector: #selector(updateLoop), userInfo: nil, repeats: true)
func createUpdateLoopTimer(interval: Double) -> RepeatingTimer {
let timer = RepeatingTimer(timeInterval: interval)
timer.eventHandler = updateLoop
timer.resume()

return timer
}

/**
* The main update loop for the whole app. This function is called every user defined time interval.
*/
@objc
func updateLoop() {
AppDelegate.menuBarItemManager.updateMenuBarItems()
DispatchQueue.main.async {
AppDelegate.menuBarItemManager.updateMenuBarItems()
}
}

/**
* Changes the update interval of the main loop to the given time interval.
*/
func changeUpdateLoopTimeInterval(interval: Double) {
// invalidate the currently used timer to stop it
currentUpdateLoopTimer.invalidate()

// create a new timer object
let timer = createUpdateLoopTimer(interval: interval)
RunLoop.current.add(timer, forMode: RunLoop.Mode.common)

currentUpdateLoopTimer = timer
// create a new timer instance
let timer = RepeatingTimer(timeInterval: interval)
timer.eventHandler = updateLoop
timer.resume()
}

// MARK: -
Expand Down
9 changes: 6 additions & 3 deletions iGlance/iGlance/iGlance/Graphs/BarGraph.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,16 @@ class BarGraph: Graph {
* Takes an image and draws the bar on the given image
*/
private func drawBarGraph(image: inout NSImage, currentValue: Double, barColor: NSColor, gradientColor: NSColor?) {
// if the current value is zero we don't have to draw anything and can return immediately
if currentValue == 0 {
return
}

// lock the focus on the image in order to draw on it
image.lockFocus()

// get the height of the bar
// prevent a value of zero since this would cause a bug when drawing the bar
let value = (currentValue == 0 ? 0.1 : currentValue)
let barHeight = Double((maxBarHeight / self.maxValue) * value)
let barHeight = Double((maxBarHeight / self.maxValue) * currentValue)

// draw the gradient if necessary
if gradientColor != nil {
Expand Down
5 changes: 5 additions & 0 deletions iGlance/iGlance/iGlance/Graphs/LineGraph.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ class LineGraph: Graph {
// iterate the values and draw a bar for each value on the correct position
var nextValuePosition = self.imageSize.width - self.borderWidth - 1
for value in valueHistory.makeIterator().reversed() {
// if the value is zero we don't have to draw anything and can continue with the loop
if value == 0 {
continue
}

// calculate the height of the bar
let barHeight = Double((self.maxbarHeight / self.maxValue) * value)

Expand Down
1 change: 1 addition & 0 deletions iGlance/iGlance/iGlance/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class Logger {
let savePanel = NSSavePanel()
savePanel.nameFieldStringValue = mostRecentLogFileUrl.lastPathComponent

DDLogInfo("Saving the most recent log file")
savePanel.begin { result in
if result == .OK {
var success = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ import CocoaLumberjack
class NetworkViewController: MainViewViewController {
// MARK: -
// MARK: Outlets
@IBOutlet private var networkUsageCheckbox: NSButton!
@IBOutlet private var networkUsageCheckbox: NSButton! {
didSet {
networkUsageCheckbox.state = AppDelegate.userSettings.settings.network.showBandwidth ? .on : .off
}
}

// MARK: -
// MARK: Actions
Expand Down
7 changes: 7 additions & 0 deletions iGlance/iGlance/iGlance/MainWindow/MainWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ class MainWindowController: NSWindowController {

required init?(coder: NSCoder) {
super.init(coder: coder)

// show the dock icon if no menu bar item is visible
// this prevents that the app is running but the user has no means to interact with the app
if !AppDelegate.menuBarItemManager.menuBarItems.contains(where: { $0.statusItem.isVisible == true }) {
NSApp.setActivationPolicy(.regular)
DDLogInfo("Dock icon is shown because no menu bar icon is visible")
}
}

// MARK: -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import Cocoa
import ServiceManagement
import CocoaLumberjack
import Sparkle

class PreferenceModalViewController: ModalViewController {
// MARK: -
Expand Down Expand Up @@ -153,6 +152,8 @@ class PreferenceModalViewController: ModalViewController {
AppDelegate.userSettings.settings.updateInterval = 2.0
}

DDLogInfo("Set the update interval to \(updateIntervalSelector.indexOfSelectedItem + 1) seconds")

// update the update loop timer
guard let appDelegate = AppDelegate.getInstance() else {
DDLogError("Could not retrieve the App Delegate Instance")
Expand Down
76 changes: 76 additions & 0 deletions iGlance/iGlance/iGlance/RepeatingTimer.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// Copyright (C) 2020 D0miH <https://github.com/D0miH> & Contributors <https://github.com/iglance/iGlance/graphs/contributors>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

import Foundation


/**
* This class is a timer that is reaping a given event handler every time interval.
*
* This class is taken from https://gist.github.com/danielgalasko/1da90276f23ea24cb3467c33d2c05768#file-repeatingtimer-swift.
* Huge thanks to Daniel Galasko <https://github.com/danielgalasko> for providing this code.
*/
class RepeatingTimer {
let timeInterval: TimeInterval

init(timeInterval: TimeInterval) {
self.timeInterval = timeInterval
}

private lazy var timer: DispatchSourceTimer = {
let timer = DispatchSource.makeTimerSource()
timer.schedule(deadline: .now() + self.timeInterval, repeating: self.timeInterval)
timer.setEventHandler { [weak self] in
self?.eventHandler?()
}
return timer
}()

var eventHandler: (() -> Void)?

private enum State {
case suspended
case resumed
}

private var state: State = .suspended

deinit {
timer.setEventHandler {}
timer.cancel()
/*
If the timer is suspended, calling cancel without resuming
triggers a crash. This is documented here https://forums.developer.apple.com/thread/15902
*/
resume()
eventHandler = nil
}

func resume() {
if state == .resumed {
return
}
state = .resumed
timer.resume()
}

func suspend() {
if state == .suspended {
return
}
state = .suspended
timer.suspend()
}
}
Loading

0 comments on commit a422dbc

Please sign in to comment.