Skip to content

Commit

Permalink
cl
Browse files Browse the repository at this point in the history
  • Loading branch information
kaunteya committed Jul 13, 2018
1 parent ecb0a4b commit 029484c
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions MacCacheCleaner/VersionHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,24 @@ struct VersionHandler {
let current = Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String
if version != current {
Log.info("Latest Version = \(version) current = \(current)")
DispatchQueue.main.async {
let alert = NSAlert()
alert.alertStyle = .warning
DispatchQueue.main.async(execute: self.showAlert)
}
}
}

alert.addButton(withTitle: "Close")
alert.addButton(withTitle: "Download")
private func showAlert() {
let alert = NSAlert()
alert.alertStyle = .warning

alert.messageText = "New version \(version) available!!"
alert.informativeText = "Please update your app for latest features & bug fixes"
let response = alert.runModal()
alert.addButton(withTitle: "Close")
alert.addButton(withTitle: "Download")

if response == .alertSecondButtonReturn {
NSWorkspace.shared.open("https://github.com/kaunteya/MacCacheCleaner")
}
}
}
alert.messageText = "New version available!!"
alert.informativeText = "Please update your app for latest features & bug fixes"
let response = alert.runModal()

if response == .alertSecondButtonReturn {
NSWorkspace.shared.open("https://github.com/kaunteya/MacCacheCleaner")
}
}
}

0 comments on commit 029484c

Please sign in to comment.