-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Description
There is a #warning in CLUUserInteractionModule class in startRecording method
- (void)startRecording {
if (!self.isRecording) {
[super startRecording];
[_gestureRecognizer setObserverDelegate:self];
#warning If some window will be destroyed how to deattach gesture recognizer from it? Possible memory leak!
[[[UIApplication sharedApplication] keyWindow] addGestureRecognizer:_gestureRecognizer];
}
}We're connecting gesture recognizer to specific window [[UIApplication sharedApplication] keyWindow].
Problems
- Key window could change during the lifetime of the app.
- What if current key window is different from current active window (in terms of touch events) at the moment
References
- Reference from Apple Docs
A window is considered the key window when it is currently receiving keyboard and non touch-related events. Whereas touch events are delivered to the window in which the touch occurred, events that don’t have an associated coordinate value are delivered to the key window. Only one window at a time can be key
- Documentation for
CLUUserInteractionModule - Documentation for
CLUGeneralGestureRecognizer