0

here is drop box link https://www.dropbox.com/s/w55tng7h81m0wss/ScreenRecording_01-17-2019%2016-24-21.MP4?dl=0

here is my constraints enter image description here

pin or annotation get bit delay while decrease height of MKMapView ,I had set constrains Greater then equal height with below view .

func manageOrderDetails (_ isVisible:Bool) {

    if isVisible {

        ctsscollViewHeight.priority = UILayoutPriority(rawValue: 999)
        ctsscollViewHeight.constant = 0
        self.seperateLineDownAddress.addshadow(top: false, left: false, bottom: false, right: false,shadowOpacity: 0.0,height:0.0)
        self.mapView.setNeedsUpdateConstraints()
        UIView.animate(withDuration: 0.6, delay: 0, options: .curveEaseInOut, animations: {
            self.view.layoutIfNeeded()
            self.orderDetailsContainer.alpha = 0.0
        }){ (isCompleted) in
            self.orderDetailsContainer.isHidden = true
        }
    }else{
        orderDetailsContainer.alpha = 0.0
        self.seperateLineDownAddress.addshadow(top: false, left: false, bottom: true, right: false,shadowOpacity: 0.15,height:1.0)
        if  orderDetailsContainer.frame.height > ((UIScreen.main.bounds.height) / 2) {
            ctsscollViewHeight.priority = UILayoutPriority(rawValue: 250)
        }else{
            ctsscollViewHeight.priority = UILayoutPriority(rawValue: 999)
        }
        ctsscollViewHeight.constant = self.orderDetailsContainer.frame.height
        self.mapView.setNeedsUpdateConstraints()
        UIView.animate(withDuration: 0.6, delay:0, options: .curveEaseInOut, animations: {
            self.orderDetailsContainer.alpha = 1.0
            self.orderDetailsContainer.isHidden = false
            self.view.layoutIfNeeded()
        })
    }
}
  • This might be because of delay in the animation, try it on the main thread with priority. – Jarvis The Avenger Jan 17 '19 at 11:18
  • I had tried with main thread but when self.view.layoutIfNeeded() has called after that pin get delayed to centre in MKMapview . – Patel Pankaj Jan 17 '19 at 11:54
  • @JarvisTheAvenger here https://stackoverflow.com/questions/30288124/how-to-keep-pin-and-map-centered-above-moving-overlay-in-an-mkmapview , it's overlaping the view with Gesture but me doing whole MKMapview height changing . – Patel Pankaj Jan 17 '19 at 12:01

0 Answers0