Trigger Shake Event in iOS SDK programatically
Is it possible to trigger the shake programatically? I am using th开发者_运维百科e undo manager in my iOS app and its working fine when I shake the device. In addition, I would like to be able to provide a UIButton, so a user can trigger the undo manager without actually shaking the device.
Is this possible?
Thanks for any help,
I believe you can just call the -undo
method on an instance of NSUndoManager
, so set your button up to trigger that.
In addition, this tutorial may be helpful. It sets up an undo button as well as allowing shake to undo.
精彩评论