Today, when you run the program for the first time, you encounter a problem
-(void) motionended: (uieventsubtype) Motion withevent: (uievent *) event
function cannot be called, the second time is good. After 1 days, I finally found the reason.
At the first run, a help page was displayed, and the page was implemented with a layer of UIWindow, which, in reality, called
Makekeyandvisible This function, when the navigation is finished, the original window is not set to key. There is no problem on the iOS8, but on the iOS9, the original window will not be able to receive motionended and other shaking events, but the click Gesture event is OK. The change is not makekeyandvisible, just use Sethidden to show the new UIWindow.
See what is called Key window, which is not specified in iOS and is explained in Mac
The Key Window
The key window responds to user input, whether from the keyboard, mouse, or alternative input devices, for an app Lication and is the primary recipient of messages from menus and panels. Usually, a window is made key when the user clicks it. Each application can has only one key window at a given time.
iOS UIWindow incorrect use results in the inability to receive motionended (Shake) function