User account types (Personal, Creator or Business) #204
Answered
by
sbertix
uniqby
asked this question in
Implemented ideas
-
How to detect User account type (Personal, Creator or Business)? |
Beta Was this translation helpful? Give feedback.
Answered by
sbertix
May 15, 2021
Replies: 2 comments 1 reply
This comment has been hidden.
This comment has been hidden.
-
Hey @uniqby, Starting with // Given a `User`.
let user: User = /* some `User` */
guard let access = user.access else { return }
// Is it a business account?
switch true {
case access.contains(.business): print("It's a business account")
case access.contains(.creator): print("It's a creator account")
default: print("It's a personal account")
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
sbertix
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @uniqby,
Starting with
5.1.0
you can now detect an account type from aUser
'saccess
property as such: