marinofaggiana 4 년 전
부모
커밋
f125daa3dc
2개의 변경된 파일15개의 추가작업 그리고 14개의 파일을 삭제
  1. 10 12
      iOSClient/Viewer/NCViewerImage/NCViewerImageDetailView.swift
  2. 5 2
      iOSClient/Viewer/NCViewerImage/NCViewerImageZoom.swift

+ 10 - 12
iOSClient/Viewer/NCViewerImage/NCViewerImageDetailView.swift

@@ -24,6 +24,9 @@ class NCViewerImageDetailView: UIView {
         super.awakeFromNib()
            
         mapView.layer.cornerRadius = 6
+        mapView.isZoomEnabled = false
+        mapView.isScrollEnabled = false
+        mapView.isUserInteractionEnabled = false
     }
     
     func updateExifLocal(metadata: tableMetadata) {
@@ -46,23 +49,18 @@ class NCViewerImageDetailView: UIView {
                 }
                 
                 DispatchQueue.main.async {
-                    self.insertDataDetail()
+                    if self.latitude > 0 && self.longitude > 0 {
+                        
+                        self.annotation.coordinate = CLLocationCoordinate2D(latitude: self.latitude, longitude: self.longitude)
+                        self.mapView.addAnnotation(self.annotation)
+                        self.mapView.setRegion(MKCoordinateRegion(center: self.annotation.coordinate, latitudinalMeters: 500, longitudinalMeters: 500), animated: false)
+                        self.locationButton.setTitle(self.location, for: .normal)
+                    }
                 }
             }
         }
     }
     
-    func insertDataDetail() {
-        
-        if self.latitude > 0 && self.longitude > 0 {
-            
-            annotation.coordinate = CLLocationCoordinate2D(latitude: latitude, longitude: longitude)
-            mapView.addAnnotation(annotation)
-            mapView.setRegion(MKCoordinateRegion(center: annotation.coordinate, latitudinalMeters: 500, longitudinalMeters: 500), animated: false)
-            locationButton.setTitle(location, for: .normal)
-        }
-    }
-    
     func hasData() -> Bool {
         if self.latitude > 0 && self.longitude > 0 {
             return true

+ 5 - 2
iOSClient/Viewer/NCViewerImage/NCViewerImageZoom.swift

@@ -103,8 +103,8 @@ class NCViewerImageZoom: UIViewController {
         updateConstraints()
         
         startY = imageView.frame.origin.y
-        panDistanceClose = view.bounds.height / 3
-        panDistanceForDetailView = view.bounds.height / 4
+        panDistanceClose = view.bounds.height / 4
+        panDistanceForDetailView = view.bounds.height / 7
         
         detailView.updateExifLocal(metadata: metadata)
 
@@ -191,6 +191,9 @@ class NCViewerImageZoom: UIViewController {
                 let offsetBottom = self.view.safeAreaInsets.bottom + 20
                 detailViewBottomConstraint.constant = imageViewBottomConstraint.constant - offsetBottom
                 isOpenDetailView = true
+                
+//                imageViewTopConstraint.constant = tempImageViewTopConstraint - detailViewHeightConstraint.constant
+//                imageViewBottomConstraint.constant = tempImageViewBottomConstraint + detailViewHeightConstraint.constant
             }
             
             // CLOSE DETAIL