Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtSabintsev committed Sep 19, 2018
1 parent beb19f1 commit 6aa91d2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Siren.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
# Version
s.version = "3.5.0"
s.version = "3.5.1"
s.swift_version = '4.2'

# Meta
Expand Down
30 changes: 14 additions & 16 deletions Sources/Siren.swift
Original file line number Diff line number Diff line change
Expand Up @@ -325,14 +325,14 @@ private extension Siren {
func updateAlertAction() -> UIAlertAction {
let title = localizedUpdateButtonTitle()
let action = UIAlertAction(title: title, style: .default) { [weak self] _ in
guard let strongSelf = self else {
guard let self = self else {
return
}

strongSelf.hideWindow()
strongSelf.launchAppStore()
strongSelf.delegate?.sirenUserDidLaunchAppStore()
strongSelf.alertViewIsVisible = false
self.hideWindow()
self.launchAppStore()
self.delegate?.sirenUserDidLaunchAppStore()
self.alertViewIsVisible = false
return
}

Expand All @@ -342,13 +342,13 @@ private extension Siren {
func nextTimeAlertAction() -> UIAlertAction {
let title = localizedNextTimeButtonTitle()
let action = UIAlertAction(title: title, style: .default) { [weak self] _ in
guard let strongSelf = self else {
guard let self = self else {
return
}

strongSelf.hideWindow()
strongSelf.delegate?.sirenUserDidCancel()
strongSelf.alertViewIsVisible = false
self.hideWindow()
self.delegate?.sirenUserDidCancel()
self.alertViewIsVisible = false
return
}

Expand All @@ -358,18 +358,18 @@ private extension Siren {
func skipAlertAction() -> UIAlertAction {
let title = localizedSkipButtonTitle()
let action = UIAlertAction(title: title, style: .default) { [weak self] _ in
guard let strongSelf = self else {
guard let self = self else {
return
}

if let currentAppStoreVersion = strongSelf.currentAppStoreVersion {
if let currentAppStoreVersion = self.currentAppStoreVersion {
UserDefaults.standard.set(currentAppStoreVersion, forKey: SirenDefaults.StoredSkippedVersion.rawValue)
UserDefaults.standard.synchronize()
}

strongSelf.hideWindow()
strongSelf.delegate?.sirenUserDidSkipVersion()
strongSelf.alertViewIsVisible = false
self.hideWindow()
self.delegate?.sirenUserDidSkipVersion()
self.alertViewIsVisible = false
return
}

Expand Down Expand Up @@ -586,7 +586,6 @@ public extension Siren {
// MARK: - Enumerated Types (Private)

private extension Siren {

/// Siren-specific UserDefaults Keys
enum SirenDefaults: String {
/// Key that stores the timestamp of the last version check in UserDefaults
Expand All @@ -595,7 +594,6 @@ private extension Siren {
/// Key that stores the version that a user decided to skip in UserDefaults.
case StoredSkippedVersion
}

}

// MARK: - Error Handling
Expand Down
2 changes: 0 additions & 2 deletions Sources/SirenDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public protocol SirenDelegate: NSObjectProtocol {
// MARK: - SirenDelegate Protocol Extension

public extension SirenDelegate {

func sirenDidDetectNewVersionWithoutAlert(title: String, message: String, updateType: UpdateType) {
printMessage()
}
Expand Down Expand Up @@ -101,5 +100,4 @@ public extension SirenDelegate {
private func printMessage(_ function: String = #function) {
SirenLog("The default implementation of \(function) is being called. You can ignore this message if you do not care to implement this method in your `SirenDelegate` conforming structure.")
}

}

0 comments on commit 6aa91d2

Please sign in to comment.