You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to integrate TCA into a project that used the UIKit lifecycle, and I'm changing it to SwiftUI with TCA. The project is quite a mess, and I'm new to TCA. There is a REST service that accepts requests from Providers signs them with a token stored Session singleton, and returns data from the executed request. However, when the request returns HTTP Error 4xx, it calls a function on the Session and the user is logged out. The Session also has a function var onSignOut: (() -> Void)? that is implemented in the UINavigationController class. The function switches the current screen to login.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to integrate TCA into a project that used the UIKit lifecycle, and I'm changing it to SwiftUI with TCA. The project is quite a mess, and I'm new to TCA. There is a
REST
service that accepts requests fromProviders
signs them with a token storedSession
singleton, and returns data from the executed request. However, when the request returns HTTP Error 4xx, it calls a function on theSession
and the user is logged out. TheSession
also has a functionvar onSignOut: (() -> Void)?
that is implemented in theUINavigationController
class. The function switches the current screen to login.How would I go about this in TCA?
The code essentialy looks like this
SomeProvider.swift
REST.swift
Session.swift
iOS 16
Beta Was this translation helpful? Give feedback.
All reactions