MultiUser is created and maintaned with ❥ by Sascha Muellner.
The latest version of MultiUser requires:
- Swift 5+
- iOS 13+
- Xcode 11+
Using SPM add the following to your dependencies
'MultiUser', 'master', 'https://github.com/smuellner/MultiUser-for-swift.git'
Using CocoaPods add the following to your Podfile:
pod 'MultiUser-for-Swift', '~> 1.0.1'
This is a Swift package with support for iOS/macOS/tvOS/watchOS that allows to store user releated data for multiple users of an application.
The UserService cares for the whole user handling and implements the UserServiceProtocol. To allow for access throughout your application place the UserService in a shared instance like the Application Delegate or use a dependency injection framework like Swinject.
// AppDelegate.swift
let userService = UserService()
Retrieve a list of all users:
let userService = UserService()
print(userService.allUsers)
//
Create a user
let user = userService.createUser()
user.username = ""
user.firstname = ""
user.lastname = ""
userService.saveUser(user)