E
E
Evgeny Zapunny2022-01-11 14:37:08
API
Evgeny Zapunny, 2022-01-11 14:37:08

How to save auth in Swift?

I just started diving into swift, and I ran into a challenge.
My application has an API, I give it a login and password, to which it sends me yes or no (conditionally), how can I save it in the application so that I don’t enter my mail and password every time, but immediately log in.

I suspect that there is an analogue of localstorage (js) in Swift, but is it correct to use it in this situation or not?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
briahas, 2022-01-11
@evgzap

You need Userdefaults

S
Sergey Vorobyov, 2022-01-12
@alert2006

Login and password should be stored in keychain

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question