问题
I have to implement pinch zoom limit in core plot. I think this is the method for pinch zoom. Could you please help what should I do in that mehtod:
(BOOL)plotSpace:(CPTPlotSpace *)space shouldScaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)interactionPoint
{
return YES;
}
Could you please share some sample code.
回答1:
If you a more concerned about the resulting plot range rather than the relative scaling amount (a common case), use this delegate method:
-plotSpace:willChangePlotRangeTo:forCoordinate:
This method informs you that a plot range is about to change to the range in the parameters. You should inspect that range, modify it as needed to meet your requirements, and return the range you want the plot space to use. It is called before any change. There are several examples of usage in the Plot Gallery example app.
来源:https://stackoverflow.com/questions/24422842/pinch-zoom-limit-in-core-plot-ios