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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -