https://github.com/swiftpackagerepository/multiuser.swift
https://github.com/swiftpackagerepository/multiuser.swift
swift swift-package-manager swift5 user user-management
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/swiftpackagerepository/multiuser.swift
- Owner: SwiftPackageRepository
- License: mit
- Created: 2020-02-29T17:30:09.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-22T02:30:20.000Z (over 4 years ago)
- Last Synced: 2025-02-01T15:44:28.579Z (5 months ago)
- Topics: swift, swift-package-manager, swift5, user, user-management
- Language: Swift
- Size: 56.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
### MultiUser handling for swift
MultiUser is **created and maintaned with ❥** by Sascha Muellner.
---
[](https://travis-ci.org/smuellner/MultiUser.swift)
[](https://codeclimate.com/github/smuellner/MultiUser.swift/maintainability)
[](https://codeclimate.com/github/smuellner/MultiUser.swift/test_coverage)
[](https://smuellner.github.io/MultiUser-for-swift)
[](https://github.com/smuellner/MultiUser-for-swift/releases/latest)
[](https://cocoapods.org/pods/MultiUser)
[](https://developer.apple.com/swift)
[](https://github.com/apple/swift-package-manager)
[](https://houndci.com)
[](https://smuellner.github.io/MultiUser-for-Swift)## Requirements
The latest version of MultiUser requires:
- Swift 5+
- iOS 13+
- Xcode 11+## Installation
### Swift Package Manager
Using SPM add the following to your dependencies``` 'MultiUser', 'master', 'https://github.com/smuellner/MultiUser-for-swift.git' ```
### CocoaPods
Using CocoaPods add the following to your Podfile:```pod 'MultiUser-for-Swift', '~> 1.0.1'```
### What?
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.### How to use?
#### Service
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**.```swift
// AppDelegate.swift
let userService = UserService()
```
#### User
Retrieve a list of all users:
```swift
let userService = UserService()
print(userService.allUsers)
//```
Create a user
```swift
let user = userService.createUser()
user.username = ""
user.firstname = ""
user.lastname = ""userService.saveUser(user)
```