A usermanager written in swift 3.0 saves you from hassle of saving your active user session.

Overview

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<String, AnyObject>) 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 }

You might also like...
The app allows the user to change text color and text content when the displayed button is clicked
The app allows the user to change text color and text content when the displayed button is clicked

Hello World! App Description This application allows the user to change text color and text content when the displayed button is clicked. App Walk-tho

Create an easy to peek SwiftUI View to showcase your own data, catalog, images, or anything you'd like.
Create an easy to peek SwiftUI View to showcase your own data, catalog, images, or anything you'd like.

Create an easy to peek SwiftUI View to showcase your own data, catalog, images, or anything you'd like.

Are you sure the chemical compounds of your daily use are 100% safe? Use Chem-Aware, identify them right now!
Are you sure the chemical compounds of your daily use are 100% safe? Use Chem-Aware, identify them right now!

View Project On Devpost: Built With: PubChem's REST API How To Install Chem Aware: Prerequiste: Latest Version of Xcode and Simulators installed The a

A Simple way help you drop or drag your source (like UIImage) between different App.

A Simple way help you drop or drag your source (like UIImage) between different App.

RetroVisor helps you with inspecting UIViews in your unit tests.

RetroVisor RetroVisor helps you with inspecting UIViews in your unit tests. You do test views in unit tests, right? Right? Usually, I mark subview pro

FlutterNativeDragAndDrop - A package that allows you to add native drag and drop support into your flutter app
FlutterNativeDragAndDrop - A package that allows you to add native drag and drop support into your flutter app

native_drag_n_drop A package that allows you to add native drag and drop support

FocusSpace - A time-management tool to help you stay focus with your friends
FocusSpace - A time-management tool to help you stay focus with your friends

FocusSpace 🏆 ElleHacks2022 - (Telus) First Place 👩 Developers Manyi Cheng(@man

The Git interface you've been missing all your life has finally arrived.
The Git interface you've been missing all your life has finally arrived.

GitUp Work quickly, safely, and without headaches. The Git interface you've been missing all your life has finally arrived. Git recently celebrated it

ExpoMod - a small application tool that lets you quickly setting up your computer for presentations / exhibitions
ExpoMod - a small application tool that lets you quickly setting up your computer for presentations / exhibitions

ExpoMod is a small application tool that lets you quickly setting up your computer for presentations / exhibitions. Or simply having useful shortcut to not being distract and keep awake your computer.

Comments
  • logOutCurrentUser error

    logOutCurrentUser error

    First of all, awesome stuff!

    logOutCurrentUser calls setCurrentUser(newCurrentUser: nil) in which assert(newCurrentUser != nil, "Trying to set current user to nil! Use [MOUser logOutCurrentUser] instead!") gets triggered.

    I guess remove the call to setCurrentUser in logOutCurrentUser?

    bug 
    opened by benaneesh 1
Owner
Zeeshan Haider
Founder of AsappStudio Full Stack and Mobile Development experts PHP Java C# JavaScript NodeJS React Angular VueJS NestJS MongoDB PostGreSQL MySQL MSSQL
Zeeshan Haider
ADA Mini challenge 2 team 14 OXY's repository in morning session

OXY 누구나 쉬는 시간이 필요하니까!! ?? Features recording the degree of stress Playing with Donggle managing and relieving your stress by yourself comparing helpfu

개발자아카데미_포스텍 5 Jun 18, 2022
You can monitor your APIs and websites on your menubar. Gives you status code 🎉 Cool & good

Hope not. Monitor your APIs and websites on your menubar. For macOS. Right now! YyeeeHav!

Steven J. Selcuk 10 Nov 29, 2022
Pendo captures product usage data, gathers user feedback, and lets you communicate in-app to onboard, educate, and guide users to value

Pendo SDK for IOS The Pendo Mobile SDK is a code-less, retro-active analytics collector across all of your app's versions. The SDK also allows present

Pendo 30 Jan 4, 2023
Tutorials from sparrowcode.io website. You can add new, translate or fix typos. Also you can add your apps from App Store for free.

Tutorials from sparrowcode.io website. You can add new, translate or fix typos. Also you can add your apps from App Store for free.

Sparrow Code 31 Jan 3, 2023
Tutorials from sparrowcode.io website. You can add new, translate or fix typos. Also you can add your apps from App Store for free.

Страницы доступны на sparrowcode.io/en & sparrowcode.io/ru Как добавить свое приложение Добавьте элемент в json /ru/apps/apps.json. Если ваше приложен

Sparrow Code 30 Nov 25, 2022
Quotes shows you famous quotes to, hopefully, give you enlightment

"Quotes" shows you famous quotes to, hopefully, give you enlightment! You can also save/favorite the quotes that you liked to review later or show to your friends!

Filipe Kunioshi 1 Mar 7, 2022
Generate Swift code from Qt5 user interfaces.

Qlift-uic Description qlift-uic takes a Qt5 user interface description file and compiles it to Swift code for use with QLift. Splitted from main QLift

Dmitriy Borovikov 1 Apr 2, 2022
Show the confetti only when the user is having fun, and if not having fun, don't show it.

SPConfetti - A simple solution to show the confetti to the user. Smoothly starts and stops. Allow set multiply diffrent particles at once. You can chang

Ivan Vorobei 225 Dec 30, 2022
A common use case is wanting to convert device identifiers such as iPhone10,1 to a user friendly name; iPhone 8.

Devices Swift package that contains all devices from https://www.theiphonewiki.com/wiki/Models. A common use case is wanting to convert device identif

null 17 Nov 28, 2022
This is a basic mobile app that allows the user to tap a button to change the color of a label.

MYAPP App Description `This is a basic mobile app that allows the user to tap a button to change the color of a label. App Walk-though Required User S

null 0 Nov 27, 2021