I am implementing an app with a trackbar which itself is a view and it needs to display the minimum and maximum values (of the variable which is associated with the bar) so I have added two labels to the top left and top right of it. Think of something like this without an enabled slider:

I would like to be able to shrink or magnify this view with pinch gesture and the below code does work fine :
-(void) handlePinch:(UIPinchGestureRecognizer *)gr
{
//Shrinking
if(gr.scale < 1)
{
//Get screen width
CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width;
//If the view's would be size is smaller than half the screen's size then don't do anything
//Otherwise shrink the view
if(self.frame.size.width * gr.scale >= screenWidth / 2)
{
//Only scale on x axis, y axes stays the same
self.transform = CGAffineTransformScale(self.transform, gr.scale, 1);
}
}
//Magnifying
else if (gr.scale > 1)
{
//Only scale on x axis, y axes stays the same
self.transform = CGAffineTransformScale(self.transform, gr.scale, 1);
}
//Set scale amount back to 1
gr.scale = 1;
}
The problem is when the view is shrank the labels on top left and right are also shrank and their font size gets smaller. Since I scale the view only horizontally this looks bizarre. I want to set the labels’ size constant and shrink everything else inside the view.
I have tried to assign a new frame rectangle with the original labels’ sizes after shrinking but it didn’t work.Do you have any tips?
edit : Setting minimumFontSize property did not work either (I don’t try minimumScaleFactor because I’m still using ios 5 sdk)
I found the solution in separating my trackbar from the view that shall support pinch gesture. It was bad design to include trackbar in it beforehand, check your ui design before putting effort on more complicated stuff.