Эх сурвалжийг харах

Fix

Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Milen Pivchev 1 жил өмнө
parent
commit
21b670bdd5

+ 8 - 2
iOSClient/More/Cells/NCMoreAppSuggestionsCell.swift

@@ -7,6 +7,7 @@
 //
 
 import Foundation
+import SafariServices
 
 class NCMoreAppSuggestionsCell: BaseNCMoreCell {
     @IBOutlet weak var talkView: UIStackView!
@@ -15,6 +16,8 @@ class NCMoreAppSuggestionsCell: BaseNCMoreCell {
 
     static let reuseIdentifier = "NCMoreAppSuggestionsCell"
 
+    weak var delegate: NCMoreAppSuggestionsCellDelegate?
+
     static func fromNib() -> UINib {
         return UINib(nibName: "NCMoreAppSuggestionsCell", bundle: nil)
     }
@@ -51,7 +54,10 @@ class NCMoreAppSuggestionsCell: BaseNCMoreCell {
     }
 
     @objc func moreAppsTapped() {
-        guard let url = URL(string: NCGlobal.shared.moreAppsUrl) else { return }
-        UIApplication.shared.open(url)
+        delegate?.moreAppsTapped()
     }
 }
+
+protocol NCMoreAppSuggestionsCellDelegate: AnyObject {
+    func moreAppsTapped()
+}

+ 13 - 0
iOSClient/More/NCMore.swift

@@ -23,6 +23,7 @@
 
 import UIKit
 import NextcloudKit
+import SafariServices
 
 class NCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
 
@@ -359,6 +360,9 @@ class NCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
 
         } else if section.type == .moreApps {
             guard let cell = tableView.dequeueReusableCell(withIdentifier: NCMoreAppSuggestionsCell.reuseIdentifier, for: indexPath) as? NCMoreAppSuggestionsCell else { return UITableViewCell() }
+
+            cell.delegate = self
+
             return cell
         } else {
             guard let cell = tableView.dequeueReusableCell(withIdentifier: CCCellMore.reuseIdentifier, for: indexPath) as? CCCellMore else { return UITableViewCell() }
@@ -445,3 +449,12 @@ class NCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
         }
     }
 }
+
+extension NCMore: NCMoreAppSuggestionsCellDelegate {
+    func moreAppsTapped() {
+        guard let url = URL(string: NCGlobal.shared.moreAppsUrl) else { return }
+        let safariViewController = SFSafariViewController(url: url)
+
+        present(safariViewController, animated: true, completion: nil)
+    }
+}