Skip to content
BeatChain is a manager for saving and retrieving string values into keychain written in swift.
Branch: master
Clone or download
sger Merge pull request #14 from sger/config-codeowners
Add codeowners configuration
Latest commit a5495ab Jul 17, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Add github templates Jul 10, 2019
BeatChain.xcodeproj Make BeatChainTests target sharable Jul 12, 2019
BeatChain Run linter on files Jul 12, 2019
BeatChainTests
docs Add credits Jul 11, 2019
.gitignore Add gitignore Jul 10, 2019
.swift-version Add documentation Jul 10, 2019
.swiftlint.yml
.travis.yml Upgrade travis xcode version Jul 12, 2019
BeatChain.podspec
CODEOWNERS Add codeowners configuration Jul 17, 2019
CODE_OF_CONDUCT.md Add markdown files for contribution and coc Jul 10, 2019
CONTRIBUTING.md Add markdown files for contribution and coc Jul 10, 2019
LICENSE Added Licence Jul 9, 2019
Makefile
Package.swift
README.md Updates README.md Jul 15, 2019

README.md

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

You can’t perform that action at this time.