Giter VIP home page Giter VIP logo

oxpatternlock's Introduction

OXPatternLock

CocoaPods Compatible CocoaPods CocoaPods CocoaPods Language

An iOS pattern lock like Android authentication written in Swift.

Installation

OXPatternLock requires Swift 3.0 and Xcode 8

CocoaPods

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

$ gem install cocoapods

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

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

target '<Your Target Name>' do
	# for stable release
    pod 'OXPatternLock'

    # for latest release
    pod 'OXPatternLock', :git => 'https://github.com/oxozle/OXPatternLock.git', :branch => 'master'
end

Then, run the following command:

$ pod install

Manually

Add OXPatternLock.swift to your project in Xcode

Usage

  1. Create an implementation of the OXPatternLockDelegate protocol.

  2. Add OXPatternLock to your Storyboard/xib file or create it manually.

  3. For security reasons all processing you have to do manually. Receive callback from delegate with patternLock instance and track array. For example: if grid size equals 3 there are 9 track poins. So result track array will be array of integers from 0 to 8 like indexes in dots array.

func didPatternInput(patterLock: OXPatternLock, track: [Int]) {
  //store, check and update patter with track array
}

Interface Builder support

There is support for Interface Builder. All properties configurable from Interface Builder.

Customization

The locker can be customized by setting any of the following public properties before displaying the OXPatternLock. The defaults are shown below.

Property Description
dot: UIImage Default dot image in grid
dotSelected: UIImage Selected icon
lockSize: Int Width and Height of grid. Default value is 3 (grid 3x3 size).
trackLineColor: UIColor Track line highlight color. Default value is White.
trackLineThickness: CGFloat Thickness of track line. Default value is 5.

Known Issues

If you find any bugs please create an issue on Github.

OXPatternLock is available under the MIT license.

oxpatternlock's People

Contributors

oxozle avatar

Watchers

James Cloos avatar Carabineiro 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.