marinofaggiana 4 жил өмнө
parent
commit
6f28c311e5

+ 2 - 1
iOSClient/NCGlobal.swift

@@ -271,6 +271,8 @@ class NCGlobal: NSObject {
     let notificationStatusAuthorizationChangedLocation          = "statusAuthorizationChangedLocation"
 }
 
+//let rootView = UIApplication.shared.keyWindow?.rootViewController?.view
+
 //DispatchQueue.main.async
 //DispatchQueue.main.asyncAfter(deadline: .now() + 0.1)
 //DispatchQueue.global().async
@@ -279,7 +281,6 @@ class NCGlobal: NSObject {
 //#if targetEnvironment(simulator)
 //#endif
 
-
 //dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
 //dispatch_async(dispatch_get_main_queue(), ^{
 //dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.3 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {

+ 4 - 4
iOSClient/Utility/NCPopupViewController.swift

@@ -191,10 +191,10 @@ public class NCPopupViewController: UIViewController {
                 }
                 
                 if keyboardPosizionEnabled {
-                    
-                    var y2 = screenSize.height - (popupHeight ?? 0)
-                    if y2 < 0 { y2 = 0 }
-                    let diff = abs(y2 - keyboardSize.height)
+                                           
+                    let popupDiffScreen = screenSize.height - ((screenSize.height - (popupHeight ?? 0)) / 2)
+                    let keyboardDiffScreen = screenSize.height - keyboardSize.height
+                    let diff = popupDiffScreen - keyboardDiffScreen
                     
                     if centerYConstraint != nil {
                         centerYConstraint?.constant = -(diff + 10)