iOS: How do I know if user left the current screen? -
i want build analytics app , send data when user leaves current screen, though there multiple ways can (back button, other button, sidebar menu, etc). there efficient way this? don't feel implementing every possible button can lead user different screen.
you should call function inside viewwilldisappear
, called every time current view controller disappear screen. see documentation of viewwilldisappear see view controller life cycle (thanks @paolo tip) below (documentation).
Comments
Post a Comment