uigesturerecognizer - Swift invert UIRotationGestureRecognizer for subviews -


i want invert rotation uirotationgesturerecognizer specific subviews. rotation occurs in 90 degree phases (so cgfloat.pi / 2 )

func localhandlerotategesture (localrotategesture: uirotationgesturerecognizer) {     if localrotategesture.state == .ended {         if localrotategesture.rotation > 0.0005{             localrotategesture.view?.transform = (localrotategesture.view?.transform)!.rotated(by: cgfloat.pi / 2) }     localrotategesture.rotation = 0  } 

works fine. access subviews , try invert movement

    var thiscell = localrotategesture.view as! custommessagecell     thiscell.cellbuttonsstackview.transform = (localrotategesture.view?.transform.inverted())!.rotated(by: cgfloat.pi / 2) 

the subviews rotate first attempt, , after doesn't! going on?


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -