AppStateChangeNotifier
Listens to app state change events (didEnterBackground and didBecomeActive, in particular) and allows other components be notified about them using a simpler API.
Properties
- AppStateChangeBlock didBackgroundBlock
The block is called when the app has entered background.
- AppStateChangeBlock didForegroundBlock
The block is called when the app has entered foreground.
- id<BlockRunner> blockRunner
The
BlockRunnerinstance specifying where to run the blocks. The default value is the main dispatch queue runner. Cannot benil, as it will reset to the default value.
Methods
- - (void) startListening
Starts listening for app state change events. This method is idempotent.
You MUST call
-stopListeningfor this object to be removed.- - (void) stopListening
Stops listening for app state change events. This method is idempotent.
This method MUST be called to
deallocthis object if you called-startListeningbefore.
Typedefs
AppStateChangeBlock
void(^)()
Type of a block that is called on an app state change event.