import UIKit
class ViewController: UIViewController {
@IBOutlet weak var myView: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
let gestureRec = UIRotationGestureRecognizer()
gestureRec.addTarget(myView, action: "rotate:")
myView.addGestureRecognizer(gestureRec)
myView.userInteractionEnabled = true
myView.multipleTouchEnabled = true
}
func rotate(sender:UIRotationGestureRecognizer)
{
myView.transform=CGAffineTransformRotate(myView.transform, sender.rotation)
sender.rotation=0
println("ok !")
}
Unfortunatly this code doesn't work for a raison I can't find, could someone help me ?
Thks in advance.
Zipette
--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swift-languag...@googlegroups.com.
To post to this group, send email to swift-l...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/06c9ecea-ec81-447d-b4a1-e1ad67bccdbe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
target
: AnyObject,action
: Selector) . It should show up in Xcode's autocomplete menu if you type in UIRotationGestureRecognizer( .To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/7745147a-7551-4935-bbcc-aa1ea7bc5860%40googlegroups.com.