Bladeren bron

build 18

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 1 jaar geleden
bovenliggende
commit
65e8f1958d
2 gewijzigde bestanden met toevoegingen van 12 en 7 verwijderingen
  1. 2 2
      Nextcloud.xcodeproj/project.pbxproj
  2. 10 5
      iOSClient/Share/NCSharePaging.swift

+ 2 - 2
Nextcloud.xcodeproj/project.pbxproj

@@ -3958,7 +3958,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 17;
+				CURRENT_PROJECT_VERSION = 18;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;
@@ -4021,7 +4021,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 17;
+				CURRENT_PROJECT_VERSION = 18;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;

+ 10 - 5
iOSClient/Share/NCSharePaging.swift

@@ -55,6 +55,7 @@ class NCSharePaging: UIViewController {
         navigationItem.leftBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_close_", comment: ""), style: .done, target: self, action: #selector(exitTapped))
         NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(notification:)), name: UIResponder.keyboardWillShowNotification, object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(notification:)), name: UIResponder.keyboardWillHideNotification, object: nil)
+        NotificationCenter.default.addObserver(self, selector: #selector(applicationDidEnterBackground(notification:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterApplicationDidEnterBackground), object: nil)
 
         // *** MUST BE THE FIRST ONE ***
         pagingViewController.metadata = metadata
@@ -89,7 +90,6 @@ class NCSharePaging: UIViewController {
         pagingViewController.dataSource = self
         pagingViewController.delegate = self
         pagingViewController.select(index: page.rawValue)
-        let pagingIndexItem = self.pagingViewController(pagingViewController, pagingItemAt: page.rawValue) as? PagingIndexItem
 
         (pagingViewController.view as? NCSharePagingView)?.setupConstraints()
         pagingViewController.reloadMenu()
@@ -132,7 +132,8 @@ class NCSharePaging: UIViewController {
         }
     }
 
-    // MARK: - Keyboard & TextField
+    // MARK: - NotificationCenter & Keyboard & TextField
+
     @objc func keyboardWillShow(notification: Notification) {
          let frameEndUserInfoKey = UIResponder.keyboardFrameEndUserInfoKey
 
@@ -148,13 +149,17 @@ class NCSharePaging: UIViewController {
          }
      }
 
-     @objc func keyboardWillHide(notification: NSNotification) {
-         view.frame.origin.y = 0
-     }
+    @objc func keyboardWillHide(notification: NSNotification) {
+        view.frame.origin.y = 0
+    }
 
     @objc func exitTapped() {
         self.dismiss(animated: true, completion: nil)
     }
+
+    @objc func applicationDidEnterBackground(notification: Notification) {
+        self.dismiss(animated: false, completion: nil)
+    }
 }
 
 // MARK: - PagingViewController Delegate