File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,14 @@ extension URL {
1515 return URL ( string: " https://4pda.to/page/ \( page) / " ) !
1616 }
1717
18+ static func githubRelease( ) -> URL {
19+ if let marketingVersion = Bundle . main. infoDictionary ? [ " CFBundleShortVersionString " ] as? String {
20+ return URL ( string: " https://github.com/SubvertDev/ForPDA/releases/tag/v \( marketingVersion) / " ) !
21+ } else {
22+ return URL ( string: " https://github.com/SubvertDev/ForPDA/ " ) !
23+ }
24+ }
25+
1826 func stripLastURLComponent( ) -> URL {
1927 var newUrl = self
2028 newUrl. deleteLastPathComponent ( )
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ final class SettingsPresenter: SettingsPresenterProtocol {
9999 // About App
100100 MenuSection ( title: R . string. localizable. aboutApp ( ) , options: [
101101 // .staticCell(model: MenuOption(title: "Проверить обновления", handler: {})),
102- . staticCell( model: MenuOption ( title: " \( R . string. localizable. version ( ) ) \( version) ( \( build. trimmingCharacters ( in: . whitespacesAndNewlines) ) ) " , handler: { } ) )
102+ . staticCell( model: MenuOption ( title: " \( R . string. localizable. version ( ) ) \( version) ( \( build. trimmingCharacters ( in: . whitespacesAndNewlines) ) ) " , handler: showReleaseOnGithub ) )
103103 ] )
104104 ]
105105
@@ -182,6 +182,11 @@ final class SettingsPresenter: SettingsPresenterProtocol {
182182 view? . showChangeDarkThemeBackgroundColorSheet ( )
183183 }
184184
185+ private func showReleaseOnGithub( ) {
186+ analytics. event ( Event . Settings. openGithubRelease. rawValue)
187+ UIApplication . shared. open ( URL . githubRelease ( ) )
188+ }
189+
185190 private func showDefaultError( ) {
186191 view? . showDefaultError ( )
187192 }
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ enum Event {
5353 case nightModeChanged
5454 case fastLoadingSystemChanged
5555 case showLikesChanged
56+ case openGithubRelease
5657 }
5758
5859}
You can’t perform that action at this time.
0 commit comments