Hello:
I have a "world view," so to speak, that consists of a large, zoomable area on a UIScrollView. I want several buttons to retain their world location when I pinch to zoom, much like pins in Google Maps do. The code I have been trying (I have been coding for hours, but I think it sounds right...although I may be just burned out) is:
- (void)scrollViewDidZoom:(UIScrollView *)scrollView
{
CGPoint center = button.center;
center.y = center.y * scrollView.zoomScale;
center.x = center.x * scrollView.zoomScale;
button.center = center;
NSLog(@"Button coordinates are %f, %f, zoomScale is %f", button.center.x, button.center.y, scrollView.zoomScale);
}
Can anyone see what I'm doing wrong?
Thanks in advance!