[ad_1]
In contrast to monitoring a person’s session through them logging in, I must discover a technique to timeout the person going via a multi-page registration course of after x period of time of inactivity.
The registration course of makes use of an observable class to retailer the varied entered values in reminiscence because the person goes via the method. Every web page of the registration is inside a NavigationView, with navigation hyperlinks on every web page that takes the person to the following display screen.
I can not simply timeout your entire registration if they’re actively going via it as a result of for some it might take a couple of minutes, whereas for somebody who has a incapacity, it would take lots longer. So long as there may be some form of exercise I need to guarantee no timeout.
Nevertheless, if the person is on web page 2 for instance, after which will get a telephone name (sending the app into the background), forgets about it till the following day (once more, simply an instance), after which comes again to the app to maintain going, I need to present an alert that upon the person tapping OK would filter the values throughout the observable class and take them again to a sure web page of the app.
Whereas there are a number of solutions on one thing like this for UIKit (not likely precisely for this, however….) I have never seen something to do that utilizing the newest SwiftUI for iOS 15+.
I want the timer to begin when the person begins the registration course of, and never be interrupted if the app goes into the background. If the person quits the app, there’s nothing I can do about that, but when the app stays open, in both the foreground OR the background, I must time them out of the registration course of, after x period of time of inactivity.
[ad_2]
