Skip to content

User account types (Personal, Creator or Business) #204

Discussion options

You must be logged in to vote

Hey @uniqby,

Starting with 5.1.0 you can now detect an account type from a User's access property as such:

// 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")
}

Replies: 2 comments 1 reply

This comment has been hidden.

Comment options

You must be logged in to vote
1 reply
@uniqby
Comment options

Answer selected by sbertix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants