Plug-n-Play login system for iOS written in Swift

Overview

Swift 4.0 Carthage compatible CocoaPods compatible Cookiecutter-Swift Build Status codecov

Prounounced Cell-Lee

Cely’s goal is to add a login system into your app in under 30 seconds!

Overview

Cely's goal is to add a login system into your app in under 30 seconds!

Background

Whether you're building an app for a client or for a hackathon, building a login system, no matter how basic it is, can be very tedious and time-consuming. Cely's architecture has been battle tested on countless apps, and Cely guarantees you a fully functional login system in a fraction of the time. You can trust Cely is handling login credentials correctly as well since Cely is built on top of Locksmith, swift's most popular Keychain wrapper.

Details:

What does Cely does for you?

  1. Simple API to store user creditials and information securely
  • Cely.save("SUPER_SECRET_STRING", forKey: "token", securely: true)
  1. Manages switching between your app's Home Screen and Login Screen with:
  • Cely.changeStatus(to: .loggedIn) // or .loggedOut
  1. Customizable starter Login screen(or you can use your login screen)

What Cely does not do for you?

  1. Network requests
  2. Handle Network errors
  3. Anything with the network

Requirements

  • iOS 11.0+
  • Xcode 9.0+
  • Swift 4.0+

Usage

Setup(30 seconds)

User Model (User.swift)

Let's start by creating a User model that conforms to the CelyUser Protocol:

// User.swift

import Cely

struct User: CelyUser {

  enum Property: CelyProperty {
    case token = "token"
  }
}

Login redirect(AppDelegate.swift)

Cely's Simple Setup function will get you up and running in a matter of seconds. Inside of your AppDelegate.swift simply import Cely and call the setup(_:) function inside of your didFinishLaunchingWithOptions method.

// AppDelegate.swift

import Cely

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: Any]?) -> Bool {
  
  Cely.setup(with: window, forModel: User(), requiredProperties: [.token])
  
  ...
}

Hit RUN!!

CelyOptions

Handle Login Credentials

Now how do we get the username and password from Cely's default LoginViewController? It's easy, just pass in a completion block for the .loginCompletionBlock. Check out CelyOptions for more info.

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

    Cely.setup(with: window!, forModel: User(), requiredProperties: [.token], withOptions: [
        .loginCompletionBlock: { (username: String, password: String) in
            if username == "asdf" && password == "asdf" {
                Cely.save(username, forKey: "username")
                Cely.save("FAKETOKEN:\(username)\(password)", forKey: "token", securely: true)
                Cely.changeStatus(to: .loggedIn)
            }
        }
    ])

    return true
}

Customize Default Login Screen

Create an object that conforms to the CelyStyle protocol and set it to .loginStyle inside of the CelyOptions dictionary when calling Cely's setup(_:) method.

// LoginStyles.swift
struct CottonCandy: CelyStyle {
    func backgroundColor() -> UIColor {
        return UIColor(red: 86/255, green: 203/255, blue: 249/255, alpha: 1) // Changing Color
    }
    func buttonTextColor() -> UIColor {
        return .white
    }
    func buttonBackgroundColor() -> UIColor {
       return UIColor(red: 253/255, green: 108/255, blue: 179/255, alpha: 1) // Changing Color
    }
    func textFieldBackgroundColor() -> UIColor {
        return UIColor.white.withAlphaComponent(0.4)
    }
    func appLogo() -> UIImage? {
        return UIImage(named: "CelyLogo")
    }
}

...

// AppDelegate.swift

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

    Cely.setup(with: window!, forModel: User.ref, requiredProperties: [.token], withOptions: [
        .loginStyle: CottonCandy(), // <--- HERE!!
        .loginCompletionBlock: { ... }        
    ])

    return true
}

Customize Transitions

In order to create a custom transition, create an object that conforms to CelyAnimator protocol and set it to .celyAnimator inside of the CelyOption dictionary when calling Cely's setup(_:) method.

struct DefaultAnimator: CelyAnimator {
    func loginTransition(to destinationVC: UIViewController?, with celyWindow: UIWindow) {
        guard let snapshot = celyWindow.snapshotView(afterScreenUpdates: true) else {
            return
        }

        destinationVC?.view.addSubview(snapshot)
        // Set the rootViewController of the `celyWindow` object
        celyWindow.setCurrentViewController(to: destinationVC)

        // Below here is where you can create your own animations
        UIView.animate(withDuration: 0.5, animations: {
            // Slide login screen to left
            snapshot.transform = CGAffineTransform(translationX: 600.0, y: 0.0)
        }, completion: {
            (value: Bool) in
            snapshot.removeFromSuperview()
        })
    }

    func logoutTransition(to destinationVC: UIViewController?, with celyWindow: UIWindow) {
        guard let snapshot = celyWindow.snapshotView(afterScreenUpdates: true) else {
            return
        }

        destinationVC?.view.addSubview(snapshot)
        // Set the rootViewController of the `celyWindow` object
        celyWindow.setCurrentViewController(to: destinationVC)

        // Below here is where you can create your own animations
        UIView.animate(withDuration: 0.5, animations: {
            // Slide home screen to right
            snapshot.transform = CGAffineTransform(translationX: -600.0, y: 0.0)
        }, completion: {
            (value: Bool) in
            snapshot.removeFromSuperview()
        })
    }
}

...

// AppDelegate.swift

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

    Cely.setup(with: window!, forModel: User.ref, requiredProperties: [.token], withOptions: [
    .celyAnimator: CustomAnimator(), // <--- HERE!!
    .loginCompletionBlock: { ... }        
    ])

    return true
}

Use your own Screens

To use your own login screen, simply create a storyboard that contains your login screen and pass that in as .loginStoryboard inside of the CelyOptions dictionary when calling Cely's setup(_:) method.

Lastly, if your app uses a different storyboard other than Main.storyboard, you can pass that in as .homeStoryboard.

⚠️ ⚠️ ⚠️ ⚠️ Be sure to make your Login screen as the InitialViewController inside of your storyboard! ⚠️ ⚠️ ⚠️ ⚠️

// AppDelegate.swift

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

    Cely.setup(with: window!, forModel: User.ref, requiredProperties: [.token], withOptions: [
        .loginStoryboard: UIStoryboard(name: "MyCustomLogin", bundle: nil),
        .homeStoryboard: UIStoryboard(name: "NonMain", bundle: nil)
    ])

    return true
}

Recommended User Pattern

import Cely

struct User: CelyUser {

    enum Property: CelyProperty {
        case username = "username"
        case email = "email"
        case token = "token"

        func securely() -> Bool {
            switch self {
            case .token:
                return true
            default:
                return false
            }
        }

        func persisted() -> Bool {
            switch self {
            case .username:
                return true
            default:
                return false
            }
        }

        func save(_ value: Any) {
            Cely.save(value, forKey: rawValue, securely: securely(), persisted: persisted())
        }

        func get() -> Any? {
            return Cely.get(key: rawValue)
        }
    }
}

// MARK: - Save/Get User Properties

extension User {

    static func save(_ value: Any, as property: Property) {
        property.save(value: value)
    }

    static func save(_ data: [Property : Any]) {
        data.forEach { property, value in
            property.save(value)
        }
    }

    static func get(_ property: Property) -> Any? {
        return property.get()
    }
}

The reason for this pattern is to make saving data as easy as:

// Pseudo network code, NOT REAL CODE!!!
ApiManager.logUserIn("username", "password") { json in
  let apiToken = json["token"].string
  
  // REAL CODE!!!
  User.save(apiToken, as: .token)
}

and getting data as simple as:

let token = User.get(.token)

API

Cely

Cely was made to help handle user credentials and handling login with ease. Below you will find documentation for Cely's Framework. Please do not hesitate to open an issue if something is unclear or is missing.

Variables

store

A class that conforms to the CelyStorageProtocol protocol. By default is set to a singleton instance of CelyStorage.

Methods

setup(with:forModel:requiredProperties:withOptions:)

Sets up Cely within your application

Example
Cely.setup(with: window, forModel: User(), requiredProperties:[.token])

// or 

Cely.setup(with: window, forModel: User(), requiredProperties:[.token], withOptions:[
  .loginStoryboard: UIStoryboard(name: "MyCustomLogin", bundle: nil),
  .HomeStoryboard: UIStoryboard(name: "My_NonMain_Storyboard", bundle: nil),
  .loginCompletionBlock: { (username: String, password: String) in
        if username == "asdf" && password == "asdf" {
            print("username: \(username): password: \(password)")
        }
    }
])
Parameters
Key Type Required? Description
window UIWindow window of your application.
forModel CelyUser The model Cely will be using to store data.
requiredProperties [CelyProperty] no The properties that cely tests against to determine if a user is logged in.
Default value: empty array.
options [CelyOption] no An array of CelyOptions to pass in additional customizations to cely.
currentLoginStatus(requiredProperties:fromStorage:)

Will return the CelyStatus of the current user.

Example
let status = Cely.currentLoginStatus()
Parameters
Key Type Required? Description
properties [CelyProperty] no Array of required properties that need to be in store.
store CelyStorage no Storage Cely will be using. Defaulted to CelyStorage
Returns
Type Description
CelyStatus If requiredProperties are all in store, it will return .loggedIn, else .loggedOut
get(_:fromStorage:)

Returns stored data for key.

Example
let username = Cely.get(key: "username")
Parameters
Key Type Required? Description
key String The key to the value you want to retrieve.
store CelyStorage no Storage Cely will be using. Defaulted to CelyStorage
Returns
Type Description
Any? Returns an Any? object in the case the value nil(not found).
save(_:forKey:toStorage:securely:persisted:)

Saves data in store

Example
Cely.save("[email protected]", forKey: "email")
Cely.save("testUsername", forKey: "username", persisted: true)
Cely.save("token123", forKey: "token", securely: true)
Parameters
Key Type Required? Description
value Any? The value you want to save to storage.
key String The key to the value you want to save.
store CelyStorage no Storage Cely will be using. Defaulted to CelyStorage.
secure Boolean no If you want to store the value securely.
persisted Boolean no Keep data after logout.
Returns
Type Description
StorageResult Whether or not your value was successfully set.
changeStatus(to:)

Perform action like LoggedIn or LoggedOut.

Example
changeStatus(to: .loggedOut)
Parameters
Key Type Required? Description
status CelyStatus enum value
logout(usesStorage:)

Convenience method to logout user. Is equivalent to changeStatus(to: .loggedOut)

Example
Cely.logout()
Parameters
Key Type Required? Description
store CelyStorage no Storage Cely will be using. Defaulted to CelyStorage.
isLoggedIn()

Returns whether or not the user is logged in

Example
Cely.isLoggedIn()
Returns
Type Description
Boolean Returns whether or not the user is logged in

Constants

Protocols

CelyUser

protocol for model class to implements

Example
import Cely

struct User: CelyUser {

  enum Property: CelyProperty {
    case token = "token"
  }
}
Required
value Type Description
Property associatedtype Enum of all the properties you would like to save for a model
CelyStorageProtocol

protocol a storage class must abide by in order for Cely to use it

Required
func set(_ value: Any?, forKey key: String, securely secure: Bool, persisted: Bool) -> StorageResult
func get(_ key: String) -> Any?  
func removeAllData()  
CelyStyle

The protocol an object must conform to in order to customize Cely's default login screen. Since all methods are optional, Cely will use the default value for any unimplemented methods.

Methods
func backgroundColor() -> UIColor
func textFieldBackgroundColor() -> UIColor
func buttonBackgroundColor() -> UIColor
func buttonTextColor() -> UIColor
func appLogo() -> UIImage?
CelyAnimator

The protocol an object must conform to in order to customize transitions between home and login screens.

Methods
func loginTransition(to destinationVC: UIViewController?, with celyWindow: UIWindow)
func logoutTransition(to destinationVC: UIViewController?, with celyWindow: UIWindow)

Typealias

CelyProperty

String type alias. Is used in User model

CelyCommands

String type alias. Command for cely to execute

enums

CelyOptions

enum Options that you can pass into Cely on setup(with:forModel:requiredProperties:withOptions:)

Options
Case Description
storage Pass in you're own storage class if you wish not to use Cely's default storage. Class must conform to the CelyStorage protocol.
homeStoryboard Pass in your app's default storyboard if it is not named "Main"
loginStoryboard Pass in your own login storyboard.
loginStyle Pass in an object that conforms to CelyStyle to customize the default login screen.
loginCompletionBlock (String,String) -> Void block of code that will run once the Login button is pressed on Cely's default login Controller
celyAnimator Pass in an object that conforms to CelyAnimator to customize the default login screen.
CelyStatus

enum Statuses for Cely to perform actions on

Statuses
Case Description
loggedIn Indicates user is now logged in.
loggedOut Indicates user is now logged out.
StorageResult

enum result on whether or not Cely successfully saved your data.

Results
Case Description
success Successfully saved your data
fail(error) Failed to save data along with a LocksmithError.

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.1.0+ is required to build Cely 2.0.0+.

To integrate Cely into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'Cely', '~> 2.1'

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate Cely into your Xcode project using Carthage, specify it in your Cartfile:

github "initFabian/Cely" ~> 2.1

Manually

If you prefer not to use either of the aforementioned dependency managers, you can integrate Cely into your project manually.

Git Submodules

  • Open up Terminal, cd into your top-level project directory, and run the following command "if" your project is not initialized as a git repository:
$ git init
  • Add Cely as a git submodule by running the following command:
$ git submodule add https://github.com/initFabian/Cely.git
$ git submodule update --init --recursive
  • Open the new Cely folder, and drag the Cely.xcodeproj into the Project Navigator of your application's Xcode project.

    It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter.

  • Select the Cely.xcodeproj in the Project Navigator and verify the deployment target matches that of your application target.

  • Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar.

  • In the tab bar at the top of that window, open the "General" panel.

  • Click on the + button under the "Embedded Binaries" section.

  • You will see two different Cely.xcodeproj folders each with two different versions of the Cely.framework nested inside a Products folder.

    It does not matter which Products folder you choose from.

  • Select the Cely.framework.

  • And that's it!

The Cely.framework is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device.

Embeded Binaries

  • Download the latest release from https://github.com/initFabian/Cely/releases
  • Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar.
  • In the tab bar at the top of that window, open the "General" panel.
  • Click on the + button under the "Embedded Binaries" section.
  • Add the downloaded Cely.framework.
  • And that's it!

License

Cely is available under the MIT license. See the LICENSE file for more info.

Comments
  • Update to Swift 5

    Update to Swift 5

    @initFabian I upgraded the Swift version, and to make it easier to update in the future, it is only declared at the project level. All targets will inherit from the one setting.

    As noted in the previous PR, this should be tagged as a new release. No code changes were needed from Swift 4.2, so I would think this can be v2.2, but upgrading to Swift 5 could be considered a breaking change, so v3.0 is also a viable option.

    opened by alextall 5
  • Update to Swift 4.2

    Update to Swift 4.2

    @initFabian The targets were still building against Swift 4.0. I've updated them to 4.2 (which should probably be marked as release 2.1) and will make another PR for 5.0 (which can then be marked as 2.2).

    opened by alextall 5
  • Sign up

    Sign up

    Hi,

    thanks for this library! Do you have any plan to implement a signup flow as well, i.e. with a separate screen and a callback similar to loginCompletionBlock?

    opened by nderkach 4
  • Dependency injection

    Dependency injection

    How should I do dependency injection? Suppose I need to access an external service inside my login viewcontroller (the initial viewcontroller for loginStoryboard). The service is defined as a protocol. I could use an implicitly unwrapped optional, but how could I set it? Thank you, Luca-

    opened by luca-i 4
  • Cely Locksmith error

    Cely Locksmith error

    Hi folks, running Cely, I get the following error on iOS 12:

    error: The operation couldn’t be completed. (Cely.LocksmithError error 7.)

    Im following the same example as in the docs, and im not sure what the issues is.

    opened by doronkatz 3
  • Carthage update failed with Cely/Cely

    Carthage update failed with Cely/Cely

    Hi, When trying to update by : carthage update with github "Cely/Cely" ~> 2.0.0 in Cartfile

    I got this response :

    A shell task (/usr/bin/env git clone --bare --quiet https://github.com/Cely/Cely.git /Users/xxx/Library/Caches/org.carthage.CarthageKit/dependencies/Cely) failed with exit code 128:
    fatal: could not read Username for 'https://github.com': terminal prompts disabled
    

    This works only with repo : github "chaione/Cely" ~> 2.0.0

    opened by canatac 3
  • v3: Add view controller instantiation

    v3: Add view controller instantiation

    How to Test:

    Test .homeViewController

    • go into AppDelegate.swift for the Cely Demo target
    • set the following option:
    .homeStoryboard: UIStoryboard(name: "Main", bundle: nil)
    
    • run application
    • VERIFY: deprecation warning appears with Fix button
    • Replace option with:
    .homeViewController: UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "SecondViewController")
    
    • run application
    • VERIFY: application builds
    • put in the credentials:
      • username: asdf
      • password: asdf
    • VERIFY: you are brought to the set view controller

    Test .loginViewController

    • set the following option:
    .loginStoryboard: UIStoryboard(name: "TestStoryboard", bundle: nil)
    
    • run application
    • VERIFY: deprecation warning appears with Fix button
    • Replace option with:
    .loginStoryboard: UIStoryboard(name: "TestStoryboard", bundle: nil).instantiateInitialViewController()
    
    • run application
    • VERIFY: a different login view controller is displayed. the elements aren't connected to anything so the login feature wont work.
    opened by initFabian 2
  • Add multiplatform support

    Add multiplatform support

    Changelog

    Installation

    CocoaPods

    CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

    $ gem install cocoapods
    

    CocoaPods 1.1.0+ is required to build Cely 2.0.0+.

    To integrate Cely into your Xcode project using CocoaPods, specify it in your Podfile:

    source 'https://github.com/CocoaPods/Specs.git'
    platform :ios, '8.0'
    use_frameworks!
    
    pod 'Cely', '~> 2.0.0'
    

    Then, run the following command:

    $ pod install
    

    Carthage

    Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.

    You can install Carthage with Homebrew using the following command:

    $ brew update
    $ brew install carthage
    

    To integrate Cely into your Xcode project using Carthage, specify it in your Cartfile:

    github "Cely/Cely" ~> 2.0.0
    

    Manually

    If you prefer not to use either of the aforementioned dependency managers, you can integrate Cely into your project manually.

    Git Submodules

    • Open up Terminal, cd into your top-level project directory, and run the following command "if" your project is not initialized as a git repository:
    $ git init
    
    • Add Cely as a git submodule by running the following command:
    $ git submodule add https://github.com/ChaiOne/Cely.git
    $ git submodule update --init --recursive
    
    • Open the new Cely folder, and drag the Cely.xcodeproj into the Project Navigator of your application's Xcode project.

      It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter.

    • Select the Cely.xcodeproj in the Project Navigator and verify the deployment target matches that of your application target.

    • Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar.

    • In the tab bar at the top of that window, open the "General" panel.

    • Click on the + button under the "Embedded Binaries" section.

    • You will see two different Cely.xcodeproj folders each with two different versions of the Cely.framework nested inside a Products folder.

      It does not matter which Products folder you choose from.

    • Select the Cely.framework.

    • And that's it!

    The Cely.framework is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device.

    Embeded Binaries

    • Download the latest release from https://github.com/ChaiOne/Cely/releases
    • Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar.
    • In the tab bar at the top of that window, open the "General" panel.
    • Click on the + button under the "Embedded Binaries" section.
    • Add the downloaded Cely.framework.
    • And that's it!
    opened by initFabian 2
  • Storage result to swift result

    Storage result to swift result

    In this PR:

    • Migrated LocksmithError to CelyStorageError
    • Migrated StorageResult to Result<T, CelyStorageError>
    • Updated bundle identifier to cely-tools
    • Removed some unused code

    I'd still consider this PR a WIP since there are still some print statements I'd like to get rid of in this PR.

    opened by initFabian 0
  • Add biometrics

    Add biometrics

    Purpose:

    Add biometrics functionality.

    New Cely Credentials API

    Please refer to documentation docs for usage. I know I pulled the trigger a little early around the documentation site, buuuttttt I wanted to focus on the experience around documentation and have that drive the code for this release. Please give your honest opinion and API design and potential shortcomings.

    Cely Documentation

    This is going to be something new and entirely different so don't feel responsible for this part of the code. It uses mkdocs to generate the site. But if you are able to check out the docs and give your thoughts that would be amazing! I understand all this was made in a cave and should be viewed as a First Draft.

    What did I do?

    • Introduces new CelyCredentials API
    • Added new file demo file CelyDemo/BiometricsLoginViewController.swift that in the Cely Demo Target that uses new CelyCredentials API
    • set CelyDemo/Appdelegate.swift to point to BiometricsLoginViewController.swift for testing
    • Add a button to CelyDemo/SettingsViewController.swift that logs credentials to the console
    • improve encapsulation (private) around methods/variables throughout Cely
    • Replace StorageResult with Swift Result
    • replace CelyStorageProtocol.removeAllData() with clearStorage()
    • Add class CelyKeychain
      • responsible for CRUD operations for KeychainObject (Keychain Items)
    • Add class CelySecureStorage
      • responsible for creating KeychainObject and storing them with CelyKeychain
      • implements CelyStorageProtocol (.clearStorage() gets called from CelyStorage when user is logging out)
    • Add class KeychainObject
      • syntactic sugar around KeychainItem. (I'm not entirely in love with how this came out around toGetMap/toLookupMap since they aren't really descriptive on what they're used for.)

    Notes

    When I created this PR, it was to finally get the code in front of someone else. In terms of what this PR sought out to do (add the biometrics functionality), it does just that. but as far as how we get there, that's where I have thoughts. Things such as should we allow the developer to use kSecClassGenericPassword instead of kSecClassInternetPassword or use kSecAttrAccessibleWhenUnlocked instead of kSecAttrAccessibleWhenUnlockedThisDeviceOnly. Definitely read Cely's documentation over Understanding Keychain to form an opinion on what Cely should/shouldn't do.

    In all, I would say this PR is 97% done. Really the only thing I don't like is around KeychainObject, but that class is only used internally and not exposed to the user/developer. so I'm not sure if we want to give that class the green light for now and just improve it at a later time.

    Lastly, this PR did a lot. I really wish it didn't, but I wanted to do one big push for v3 to get the ball rolling.

    How to Test:

    1. Have device with biometrics (FaceID/TouchID)
    2. Pull down branch
    3. Change Scheme to Cely Demo
    4. Error will happen around team/bundleID. change values to allow App to run
    • if you can help with find a long term solution on this, that would be awesome!
    1. Log into app with the credentials username:asdf and password:asdf
    2. VERIFY: App logs you in
    3. go to settings page and click Get Credentials
    4. VERIFY: biometrics are run on device
    5. VERIFY: credentials are logged to the console.
    opened by initFabian 0
  • Non-iOS targets fail to build

    Non-iOS targets fail to build

    We have targets for macOS, watchOS, tvOS that don’t build (watchOS doesn’t even make sense 🤪). I’m leaving this here so I can fix/remove as appropriate.

    opened by alextall 0
  • Only compatible with storyboards?

    Only compatible with storyboards?

    I am trying out Cely in a small app that I am building, but I am not using Storyboards. I use the 'old' way, of just instantiating a UIViewController and assigning it to my UIWindow.

    AppDelegate.swift

    self.window = UIWindow()
    self.window?.rootViewController = MainViewController()
    self.window?.makeKeyAndVisible()
    

    After this I setup Cely: Cely.setup(with: window, forModel: User(), requiredProperties: [.token], withOptions: nil)

    But while starting my application it crashes with the following error message: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'Main' in bundle NSBundle

    Would using a custom CelyAnimator solve this (not sure?)

    help wanted 
    opened by depl0y 2
  • How to integrate expirable into CelyUser to manage different tokens?

    How to integrate expirable into CelyUser to manage different tokens?

    @initFabian I'd like to get your opinion on how to add the following Expirable protocol so I can manage tokens.

    https://github.com/AndrewSB/Expirable

    This will enable us see which token expired or is expiring soon. So far following your example I don't know where I am able to enable the Expirable protocol

    struct AuthUser: CelyUser {
        
        enum Property: CelyProperty {
            
            case username = "username"
            case email = "email"
            case access_token = "access_token"
            case refresh_token = "refresh_token"
                
            func securely() -> Bool {
                switch self {
                case .access_token, .refresh_token:
                    return true
                default:
                    return false
                }
            }
            
            func persisted() -> Bool {
                switch self {
                case .access_token, .refresh_token:
                    return true
                default:
                    return false
                }
            }
            
            func save(_ value: Any) {
                Cely.save(value, forKey: rawValue, securely: securely(), persisted: persisted())
            }
            
            func get() -> Any? {
                return Cely.get(key: rawValue)
            }
        }
    }
    
    // MARK: - Save/Get User Properties
    
    extension AuthUser {
        
        static func save(_ value: Any, as property: Property) {
            property.save(value)
        }
        
        static func save(_ data: [Property : Any]) {
            data.forEach { property, value in
                property.save(value)
            }
        }
        
        static func get(_ property: Property) -> Any? {
            return property.get()
        }
    }
    
    enhancement discussion 
    opened by rlam3 3
Releases(2.1.3)
Owner
null
👷‍♀️ login tutorial using Kakao iOS SDK

KakaoLoginTutorial-iOS ??‍♀️ login tutorial using Kakao iOS SDK 목차 디자인 가이드 설정단계 애플리케이션 등록 CocoaPods 통해 모듈 설치 Info.plist 설정 초기화 시작하기 전 카카오톡으로 로그인 기본 웹

Hyungyu Kim 8 Dec 3, 2022
LoginKit is a quick and easy way to add a Login/Signup UX to your iOS app.

LoginKit About LoginKit is a quick and easy way to add Facebook and email Login/Signup UI to your app. If you need to quickly prototype an app, create

Icalia Labs 653 Dec 17, 2022
Convenient & secure logging during development & release in Swift 3, 4 & 5

Colorful, flexible, lightweight logging for Swift 3, Swift 4 & Swift 5. Great for development & release with support for Console, File & cloud platfor

SwiftyBeaver 5.6k Dec 31, 2022
Login-screen-UI - A simple iOS login screen written in Swift 5

This project has been updated to Swift 5 and Xcode 11.2 About This is a simple i

Kushal Shingote 2 Feb 4, 2022
GLWalkthrough is an easily configurable plug-and-play tool to add walkthrough or coachmarker functionality to your app with ease.

GLWalkthrough Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements Installation GLWa

Gokul 40 Dec 17, 2022
API surface for Swift plug-ins using the Swift Plugin Manager

SwiftPlugin The minimal API surface required for the Swift Plugin Manager to create instances from a loaded plugin. Additional documentation and refer

Joakim Hassila 2 Mar 25, 2022
An Xcode formatter plug-in to format your swift code.

Swimat Swimat is an Xcode plug-in to format your Swift code. Preview Installation There are three way to install. Install via homebrew-cask # Homebrew

Jintin 1.6k Jan 7, 2023
A danger-swift plug-in to manage/post danger checking results with markdown style

DangerSwiftShoki A danger-swift plug-in to manage/post danger checking results with markdown style Install DangerSwiftShoki SwiftPM (Recommended) Add

YUMEMI Inc. 4 Dec 17, 2021
A danger-swift plug-in to report xcresult in your PR

DangerSwiftKantoku A danger-swift plug-in report xcresult in your PR. Install DangerSwiftKantoku SwiftPM (Recommended) Add dependency package to your

YUMEMI Inc. 9 Nov 18, 2022
Swift Package Manager plug-in to compile Metal files that can be debugged in Xcode Metal Debugger.

MetalCompilerPlugin Swift Package Manager plug-in to compile Metal files that can be debugged in Xcode Metal Debugger. Description Swift Package Manag

Jonathan Wight 10 Oct 30, 2022
Personal plug-in library

PPILibrary Personal plug-in library 功能介绍 Core 核心基础扩展, 不依赖于任何三方库 使用 根据subspec指定 pod 'PPILibrary', :subspecs => ['Core'], :git => 'https://github.com/Sh

ShenYj 1 Mar 29, 2022
An Xcode plug-in to format your code using SwiftLint.

SwiftLintXcode An Xcode plug-in to format your code using SwiftLint. Runs swiftlint autocorrect --path CURRENT_FILE before *.swift file is saved. IMPO

Yuya Tanaka 348 Sep 18, 2022
Customizable login screen, written in Swift 🔶

LFLoginController Customizable login screen, written in Swift Creating Login screens is boring and repetitive. What about implementing and customizing

Awesome Labs 152 Oct 30, 2022
Beautiful animated Login Alert View. Written in Objective-C

UIAlertView - Objective-C Animated Login Alert View written in Swift but ported to Objective-C, which can be used as a UIAlertView or UIAlertControlle

Letovsky 2 Dec 22, 2021
Animated Play and Pause Button written in Swift, using CALayer, CAKeyframeAnimation.

AnimatablePlayButton Animated Play and Pause Button written in Swift, using CALayer, CAKeyframeAnimation. features Only using CAShapeLayer, CAKeyframe

keishi suzuki 77 Jun 10, 2021
SimpleAuth is designed to do the hard work of social account login on iOS

SimpleAuth is designed to do the hard work of social account login on iOS. It has a small set of public APIs backed by a set of "providers"

Caleb Davenport 1.2k Nov 17, 2022
A simple way to implement Facebook and Google login in your iOS apps.

Simplicity Simplicity is a simple way to implement Facebook and Google login in your iOS apps. Simplicity can be easily extended to support other exte

Simplicity Mobile 681 Dec 18, 2022
👷‍♀️ login tutorial using Kakao iOS SDK

KakaoLoginTutorial-iOS ??‍♀️ login tutorial using Kakao iOS SDK 목차 디자인 가이드 설정단계 애플리케이션 등록 CocoaPods 통해 모듈 설치 Info.plist 설정 초기화 시작하기 전 카카오톡으로 로그인 기본 웹

Hyungyu Kim 8 Dec 3, 2022
Custom MacBook login screen and pam modules using multipeer connectivity and usb hardware checks with iOS app for sign in.

Custom MacBook login screen and pam modules using multipeer connectivity and usb hardware checks with iOS app for sign in.

null 2 Aug 17, 2022