ios - How to pinch to zoom a view without making the view bigger? -


this have:

func handlepinching(recognizer : uipinchgesturerecognizer) {     self.layer.transform = catransform3dmakeaffinetransform(cgaffinetransformscale(self.transform, recognizer.scale, recognizer.scale));     recognizer.scale = 1.0; } 

using self.view.transform makes bigger. want make zoom "internally" (i don't know how explain it).

so i'm not 100% sure understand question guess it.

for example want zoom on image without zooming other element of ui (navbar, buttons, ...) right?

so guess in you're example you're in viewcontroller, means, when change scale of self.view you'll zoom everything. have apply scale on specific view want zoom in.

in example below, zoom on image, image inside of uiimageview, , imageview subview of self.view. , apply transform on imageview.

moreover think little bit confused on how zoom, considering view want zoom imageview need

imageview.transform = cgaffinetransformmakescale(recognizer.scale,recognizer.scale) 

i hope answer question, let me know if not clear.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -