0

I can get the colour on a point of a view as proposed in https://stackoverflow.com/a/25956283/99214 by @jack-song . However when I animate the view

let scaledAndTranslatedTransform = imageViewShape.transform.translatedBy(x: -imageViewShape.bounds.width * 2 - 200, y: 0.0)

UIView.animate(withDuration: TimeInterval(duration), animations: {
            self.imageViewShape.transform = scaledAndTranslatedTransform
        }, completion: { _ in

})

I cannot get the colour of the point as the view moves. How can I get the point when the view is moving?

abinop
  • 3,153
  • 5
  • 32
  • 46

1 Answers1

1

Use presentationLayer property of view's layer because if we see in MVC pattern you will have model before animation and after animation as core animation classes are model in MVC pattern and so if you want to get the values in between animation use presentation layer

Devil Decoder
  • 966
  • 1
  • 10
  • 26