Disabling pointers in Swift -
how can value of variable variable without them having same pointer? is, in code below, keepscale
value getting updated 1
when after recognizer.rotation
set 1
.
code
var keepscale : cgfloat = 1 func handlepinch(recognizer : uipinchgesturerecognizer) { if let view = recognizer.view { view.transform = cgaffinetransformscale(view.transform, recognizer.scale, recognizer.scale) keepscale = recognizer.scale println(keepscale) recognizer.scale = 1 println(keepscale) } }
example logs
0.5
1.0
ok since scale ratio had multiply keepscale
value recognizer.scale
, not set equal.
Comments
Post a Comment