marinofaggiana 4 ani în urmă
părinte
comite
fb9c85eeb7

+ 1 - 1
iOSClient/Viewer/NCViewerImage/NCViewerImage.swift

@@ -584,7 +584,7 @@ extension NCViewerImage: UIPageViewControllerDelegate, UIPageViewControllerDataS
     
     
     func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) {
     func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) {
         
         
-        if (completed && self.nextIndex != nil) {
+        if (completed && nextIndex != nil) {
             previousViewControllers.forEach { viewController in
             previousViewControllers.forEach { viewController in
                 let viewerImageZoom = viewController as! NCViewerImageZoom
                 let viewerImageZoom = viewController as! NCViewerImageZoom
                 viewerImageZoom.scrollView.zoomScale = viewerImageZoom.scrollView.minimumZoomScale
                 viewerImageZoom.scrollView.zoomScale = viewerImageZoom.scrollView.minimumZoomScale

+ 43 - 37
iOSClient/Viewer/NCViewerImage/NCViewerImageDetailView.swift

@@ -31,29 +31,29 @@ class NCViewerImageDetailView: UIView {
         mapView.isUserInteractionEnabled = false
         mapView.isUserInteractionEnabled = false
     }
     }
     
     
-    @IBAction func touchLocation(_ sender: Any) {
-        if self.latitude > 0 && self.longitude > 0 {
-            openMapForPlace()
+    func hasData() -> Bool {
+        if latitude > 0 && longitude > 0 {
+            return true
+        } else {
+            return false
         }
         }
     }
     }
     
     
-    func openMapForPlace() {
-
-        let latitude: CLLocationDegrees = self.latitude
-        let longitude: CLLocationDegrees = self.longitude
-
-            let regionDistance:CLLocationDistance = 10000
-            let coordinates = CLLocationCoordinate2DMake(latitude, longitude)
-        let regionSpan = MKCoordinateRegion(center: coordinates, latitudinalMeters: regionDistance, longitudinalMeters: regionDistance)
-            let options = [
-                MKLaunchOptionsMapCenterKey: NSValue(mkCoordinate: regionSpan.center),
-                MKLaunchOptionsMapSpanKey: NSValue(mkCoordinateSpan: regionSpan.span)
-            ]
-            let placemark = MKPlacemark(coordinate: coordinates, addressDictionary: nil)
-            let mapItem = MKMapItem(placemark: placemark)
-            mapItem.name = location
-            mapItem.openInMaps(launchOptions: options)
-        }
+    func show(height: CGFloat, textColor: UIColor) {
+        detailViewHeightConstraint.constant = height
+        dateLabel.textColor = textColor
+        isHidden = false
+    }
+    
+    func hide() {
+        isHidden = true
+    }
+    
+    func isShow() -> Bool {
+        return !isHidden
+    }
+    
+    //MARK: - EXIF
     
     
     func updateExifLocal(metadata: tableMetadata) {
     func updateExifLocal(metadata: tableMetadata) {
                     
                     
@@ -93,25 +93,31 @@ class NCViewerImageDetailView: UIView {
         }
         }
     }
     }
     
     
-    func hasData() -> Bool {
-        if latitude > 0 && longitude > 0 {
-            return true
-        } else {
-            return false
-        }
-    }
+    //MARK: - Map
     
     
-    func show(height: CGFloat, textColor: UIColor) {
-        detailViewHeightConstraint.constant = height
-        dateLabel.textColor = textColor
-        isHidden = false
-    }
-    
-    func hide() {
-        isHidden = true
+    func openMapForPlace() {
+
+        let latitude: CLLocationDegrees = self.latitude
+        let longitude: CLLocationDegrees = self.longitude
+
+        let regionDistance:CLLocationDistance = 10000
+        let coordinates = CLLocationCoordinate2DMake(latitude, longitude)
+        let regionSpan = MKCoordinateRegion(center: coordinates, latitudinalMeters: regionDistance, longitudinalMeters: regionDistance)
+        let options = [
+            MKLaunchOptionsMapCenterKey: NSValue(mkCoordinate: regionSpan.center),
+            MKLaunchOptionsMapSpanKey: NSValue(mkCoordinateSpan: regionSpan.span)
+        ]
+        let placemark = MKPlacemark(coordinate: coordinates, addressDictionary: nil)
+        let mapItem = MKMapItem(placemark: placemark)
+        mapItem.name = location
+        mapItem.openInMaps(launchOptions: options)
     }
     }
     
     
-    func isShow() -> Bool {
-        return !isHidden
+    //MARK: - Action
+
+    @IBAction func touchLocation(_ sender: Any) {
+        if self.latitude > 0 && self.longitude > 0 {
+            openMapForPlace()
+        }
     }
     }
 }
 }