Closed aab29 closed 3 years ago
Thanks for the PR!
Let me do some testing first.
btw, I'm not sure when the class is imported to swift, will paused
property be translated to isPaused
automatically? Since swift version of GLKViewController
, this property is named isPaused
. https://developer.apple.com/documentation/glkit/glkviewcontroller/1620712-ispaused
If it is not automatically translated, I think we should keep isPaused
as alias of paused
.
Good catch! 😊 I'm not sure how this works in Swift yet, but since GLKit's declaration includes getter=isPaused
, we should definitely make sure to match it.
Good catch! 😊 I'm not sure how this works in Swift yet, but since GLKit's declaration includes
getter=isPaused
, we should definitely make sure to match it.
Interesting, I did test with swift. The property’s name did become “isPaused”.
The
paused
,pauseOnWillResignActive
, andresumeOnDidBecomeActive
properties implemented in https://github.com/kakashidinho/metalangle/pull/41 work very well overall, but I noticed an issue with them in an app I work on. The app previously used aGLKViewController
, which I've replaced with anMGLKViewController
. After the replacement, some functionality that relied onpauseOnWillResignActive
andresumeOnDidBecomeActive
stopped working properly.I did some investigation and figured out that a subtle difference in behavior is to blame. When an app displaying a
GLKViewController
resigns active state or becomes active, the view controller calls itssetPaused:
method. This is important because the app may overridesetPaused:
to trigger other functionality. CurrentlyMGLKViewController
pauses and resumes itself in this situation without ever callingsetPaused:
, so this PR changes it to match the behavior of GLKit.As mentioned in the comments of https://github.com/kakashidinho/metalangle/pull/41 , the
isPaused
property ofGLKViewController
is actually namedpaused
. This PR changes the property name inMGLKViewController
to match GLKit as well.