0

I have code to draw a circle in ios

int size = 60
int radius = size/2;

self.tapSelectionView = [[UIView alloc] initWithFrame:CGRectMake(longPressedPoint.x - radius, longPressedPoint.y - radius, size, size)];
self.tapSelectionView.layer.cornerRadius = radius;
self.tapSelectionView.layer.borderColor = [UIColor greenColor].CGColor;
self.tapSelectionView.backgroundColor = [UIColor clearColor];
self.tapSelectionView.layer.borderWidth = 2;
[self.view addSubview:self.tapSelectionView];

CGPoint centerOfOriginalFrame = CGPointMake(self.tapSelectionView.frame.origin.x + radius, self.tapSelectionView.frame.origin.y + radius);
centerOfDrawnCircle = centerOfOriginalFrame;

and now I want to make this circle to expand and compress on pinch in and pinch out gestures in ios.Could anyone please help me on how to get this, i'm new to ios development.

ss g
  • 11
  • 3

1 Answers1

0
  1. Just add pinch gesture to your circle i.e on tapSelectionView
  2. on pinch gesture action:- set CGAfflineTransform to your tapSelectionView i.e transform scale to expand(zoom out) and (zoom in)

If you need example code you can surely see this link

Community
  • 1
  • 1
Vizllx
  • 9,135
  • 1
  • 41
  • 79