The `ReleaseNotes` struct has been replaced with an extension on URL. Release Notes can now be opened on all versions of NNW.
This commit is contained in:
Stuart Breckenridge
2020-08-15 15:01:00 +08:00
parent 9218b4d95c
commit ddbf0fffb6
9 changed files with 133 additions and 67 deletions

View File

@@ -15,4 +15,17 @@ extension URL {
scheme == "mailto" ? URLComponents(url: self, resolvingAgainstBaseURL: false)?.path : nil
}
/// URL pointing to current app version release notes.
static var releaseNotes: URL {
let appVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? ""
var gitHub = "https://github.com/Ranchero-Software/NetNewsWire/releases/tag/"
#if os(macOS)
gitHub += "mac-\(String(describing: appVersion))"
return URL(string: gitHub)!
#else
gitHub += "ios-\(String(describing: appVersion))"
return URL(string: gitHub)!
#endif
}
}