Description
A usermanager written in swift 3.0 saves you from hassle of saving your active user session.
SwiftUserManager
A usermanager written in swift 3.0 saves you from hassle of saving your active user session.
** Call api and give the json to MOProfile to make a model and call UserManager.setCurrentUser(model)
let profileFromServer = [
"firstName" : "Zeeshan",
"userName" : "xeieshan",
"lastName" : "Haider",
"id" : 1,
"email" : "[email protected]"
] as [String : Any]
let profileModel : MOProfile = MOProfile(profileFromServer as Dictionary)
UserManager.setCurrentUser(newCurrentUser: profileModel)
**Now you can use this**
debugPrint((UserManager.currentUser?.firstName)! as String)
**To logout simply call**
UserManager.logOutUserAndClearToken()
**If you want to see if your user is logged (for autologin)**
if UserManager.currentUser != nil {
// Take to App
} else {
// Take to Login
}
SwiftUserManager alternatives and similar libraries
Based on the "Authentication" category.
Alternatively, view SwiftUserManager alternatives based on common mentions on social networks and blogs.
-
Simplicity
A simple way to implement Facebook and Google login in your iOS apps. -
Heimdallr.swift
Easy to use OAuth 2 library for iOS, written in Swift. -
SwiftyOAuth
A simple OAuth library for iOS with a built-in set of providers -
AuthenticationViewController
A simple to use, standard interface for authenticating to oauth 2.0 protected endpoints via SFSafariViewController. -
Swift Starter Kit ๐๐๐ฅ๐ฅ
Swift Starter Kit with Firebase & Facebook Login Onboarding -
InstagramSimpleOAuth
A quick and simple way to authenticate an Instagram user in your iPhone or iPad app. -
OhMyAuth
:closed_lock_with_key: Simple OAuth2 library with a support of multiple services. -
InstagramLogin
A simple way to authenticate Instagram accounts on iOS. -
DropboxSimpleOAuth
A quick and simple way to authenticate a Dropbox user in your iPhone or iPad app. -
LinkedInSignIn
Simple view controller to log in and retrieve an access token from LinkedIn. -
InstagramAuthViewController
A UIViewController subclass for Instagram authentication. -
BoxSimpleOAuth
A quick and simple way to authenticate a Box user in your iPhone or iPad app.
Appwrite - The open-source backend cloud platform
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of SwiftUserManager or a related project?
README
SwiftUserManager
A usermanager written in swift 3.0 saves you from hassle of saving your active user session.
Call api and give the json to MOProfile to make a model and call
UserManager.setCurrentUser(model)
let profileFromServer = [ "firstName" : "Zeeshan", "userName" : "xeieshan", "lastName" : "Haider", "id" : 1, "email" : "[email protected]" ] as [String : Any]
let profileModel : MOProfile = MOProfile(profileFromServer as Dictionary) UserManager.setCurrentUser(newCurrentUser: profileModel)
You can access properties of your loggedin user like
debugPrint((UserManager.currentUser?.firstName)! as String)
To logout simply call
UserManager.logOutUserAndClearToken()
If you want to see if your user is logged (for autologin)
if UserManager.currentUser != nil { // Take to App } else { // Take to Login // After Login save user }