New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delegate for latest version installed and check for how long current app has been released #99
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additions looks great, but I have some stylistic changes that I'd like to be implemented.
@@ -538,12 +557,19 @@ fileprivate extension Siren { | |||
return url | |||
} | |||
|
|||
func daysSince(lastVersionCheckPerformed lastCheckDate: Date) -> Int { | |||
func daysSince(_ date: Date) -> Int { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you do me a favor and rename the method's so their signature looks as follows:
func days(since date:)
return components.day! | ||
} | ||
|
||
func daysSince(dateString: String) -> Int? { | ||
let dateformatter = DateFormatter() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DateFormatter's, at least the ObjC Foundation NSDaeFormatter is notoriously expensive to initialize. Can we place the dateFormatter initialization and basic (non-dateString) configuration in a static func?
return components.day! | ||
} | ||
|
||
func daysSince(dateString: String) -> Int? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you do me a favor and rename the method's so their signature looks as follows:
func days(since dateString:)
All feedback addressed. |
Looks good! Will merge and may make one stylistic tweak. I'll post back here when this is available via CocoaPods (should be soon) |
This is now available in Siren 1.1.0. Thanks for this PR! |
This PR adds
SirenDelegate
to notify when the check finished and the latest version is already installed.showAlertAfterCurrentVersionHasBeenReleasedForDays
which can be set to a number of days and the update alert then only shows up if the current version has already been released for the set number of days.