How can I rotate the view based on the origin of the rotation and what is the position given in the view's coordinate system?
I find this rather confusing. When you want to rotate the view, it will be rotated by its center point. But that's not always good. Therefore, if you need to rotate to the specified origin in your view, you will need to set the anchorPoint property of the view layer.
Now the problem is that this anchorPoint property takes on rather confusing values ββfor the average intelligent programmer;)
They are, as I know, from 0 to 1. In addition, the coordinate system is flipped to the view coordinate system, where I believe that 0 is the smallest value in the view coordinate system and 1 is the largest.
myView.layer.anchorPoint = CGPointMake(0.5, 0.5);
set anchorPoint in the middle of the view.
What should I do if I only know: - my view is 100 x 150 units large - I want the anchorPoint to be at x = 100 and y = 20, in my opinion the coordinate system
Any idea how to achieve this?
a source to share