BaasUser
public class BaasUser: NSObject, NSCoding
class BaasUser
manages the BaasBox logged in user
You can get the user data and manages it from here
-
Decodes the saved object
Declaration
Swift
required convenience public init?(coder aDecoder: NSCoder) -
Encodes the saved object
Declaration
Swift
public func encode(with aCoder: NSCoder) -
Returns a bool if the user is locally authenticated
- return: Boolean for local authentication
Declaration
Swift
public func isAuthenticated() -> Bool
-
Upload the saved user updates to the BaasBox server
Declaration
Swift
public func update(completion: BaasBox.BaasCompletion) -
Logout function, will call the function you pass in logoutStrategy on completion
Declaration
Swift
public func logout(pushToken: String = "",completion: BaasBox.BaasCompletion ) -
Refresh the saved data of the user from the server
Declaration
Swift
public func refresh(completion: BaasBox.BaasCompletion ) -
Change the user password.
NOTE:
Your session code will change
- parameters:
- from : Old password
- to : New password
Declaration
Swift
public func changePassword(from: String, to: String, completion: BaasBox.BaasCompletion)Parameters
fromOld password
toNew password
- parameters:
-
Link the user with a social login
- parameters:
- to:
BaasBox.socialTypes, the type of the social login - token: The token provided by the third party social sdk
- to:
Declaration
Parameters
toBaasBox.socialTypes, the type of the social logintokenThe token provided by the third party social sdk
- parameters:
-
Follows a user
- parameters: -username: The username of the user to follow
Declaration
Swift
public func follow(username: String, completion: BaasBox.BaasCompletion) -
Unfollows a user
- parameters: -username: The username of the user to unfollow
Declaration
Swift
public func unfollow(username: String, completion: BaasBox.BaasCompletion) -
Get the user follows
Declaration
Swift
public func getFollows(completion: BaasBox.BaasCompletion) -
Get the user followers
Declaration
Swift
public func getFollowers(completion: BaasBox.BaasCompletion)
BaasUser Class Reference