Code Monkey home page Code Monkey logo

beatchain's Introduction

BeatChain

BeatChain is a manager for saving and retrieving string values into keychain written in swift.

Build Status Cocoapods Compatible Carthage compatible Swift 4.0.x platforms

Contents

Requirements

  • iOS 10.0+
  • Swift 4.0+
  • Xcode 10.0+

Installation

CocoaPods

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

$ gem install cocoapods

to integrate BeatChain into your Xcode project using CocoaPods, specify it in your Podfile:

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

target '<Your Target Name>' do
    pod 'BeatChain', '~> 1.0.0'
end

then, run the following command, this will fetch and install the BeatChain pod:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew install carthage

to integrate BeatChain into your Xcode project using Carthage, specify it in your Cartfile:

github "beatlabs/BeatChain" "master"

Run carthage update to build the framework and drag the built BeatChain.framework into your Xcode project.

Swift Package Manager

You can use The Swift Package Manager to install BeatChain by adding the proper description to your Package.swift file:

// swift-tools-version:4.0
import PackageDescription

let package = Package(
    name: "YOUR_PROJECT_NAME",
    dependencies: [
        .package(url: "https://github.com/beatlabs/BeatChain.git", from: "1.0.0"),
    ]
)

then, run the following command:

$ swift build

Manually

If you prefer you can build the framework manually and drag generated framework BeatChain.framework into your Xcode project.

Usage

Quick Start

import BeatChain
let keychainManager = KeychainManager()

// save password into keychain
do {
    let item = GenericPasswordItem(account: "username", accessGroup: "accessGroup")
    try keychainManager.saveValue(password, to: item)
} catch {
    assertionFailure("Save password failed")
}

// read password from keychain
do {
    let item = GenericPasswordItem(account: "account", accessGroup: "accessGroup")
    return try keychainManager.readValue(item)
} catch KeychainManagerError.noItemFound {
    assertionFailure("Item not found")
} catch {
    assertionFailure("Get password failed")
}

// delete password item from keychain
do {
    let item = GenericPasswordItem(account: nil, accessGroup: "accessGroup")
    try keychainManager.deleteItem(item)
} catch {
    assertionFailure("Delete password failed")
}

Documentation

Install Jazzy

$ gem install jazzy

then you can generate documentation by using the following command:

$ jazzy --min-acl internal

License

BeatChain is released under the Apache License Version 2.0. See LICENSE for details.

Authors

The iOS BEAT team

https://github.com/beatlabs/BeatChain

Credits

beatchain's People

Contributors

sger avatar tasostsolis avatar psy2k avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.