GithubHelp home page GithubHelp logo

ryasnoy / applocker Goto Github PK

View Code? Open in Web Editor NEW
206.0 12.0 46.0 461 KB

AppLocker - simple lock screen for iOS Application ( Swift 4+, iOS 9.0+) Touch ID / Face ID

License: MIT License

Swift 94.70% Ruby 5.30%
swift pincode passcode lockscreen locker applocker security ios swift-3 swift-language

applocker's Introduction

Swift License Platform Twitter

AppLocker

Very simple locker for your iOS application

Preview

Modes

enum ALMode { // Modes for AppLocker
  case validate
  case change
  case deactive
  case create
}

Configuration

struct ALOptions { // The structure used to display the controller
  var title: String?
  var subtitle: String?
  var image: UIImage?
  var color: UIColor?
  var isSensorsEnabled: Bool?
}

Example

Simple call of controller

AppLocker.present(with: .create) // validate, deactive, change

Calling the controller with configuration

    var options = ALOptions()
    options.image = UIImage(named: "face")!
    options.title = "Devios Ryasnoy"
    options.isSensorsEnabled = true
    options.onSuccessfulDismiss = { (mode: ALMode?) in
        if let mode = mode {
            print("Password \(String(describing: mode))d successfully")
        } else {
            print("User Cancelled")
        }
    }
    options.onFailedAttempt = { (mode: ALMode?) in
        print("Failed to \(String(describing: mode))")
    }

    AppLocker.present(with: mode, and: appearance, over: self)

Requirements

AppLocker is written in Swift 3. iOS 8.0+ Required

Installation

Just move the Source folder to your project

CocoaPods

  pod 'AppLocker'

For iOS 8.0

  pod 'AppLocker', ~> '1.0.1'

Author

Oleg Ryasnoy, [email protected]

Telegram: https://t.me/ryasnoy

License

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

applocker's People

Contributors

bugkingk avatar davidozman avatar ryasnoy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

applocker's Issues

[RESOLVED]Location of saved pin is bad

Hey,

i checked the detail Code of the AppLocker Implementation and i was not amused to see that you save the pin in the UserDefaults by default. Its really unsecure to use that place and it seems that there is no chance to change the location? Im right?
Is it possible to give the user the control over the save location of the pin code?

Callback when done

Hi,

Thanks for a very nice tool.

Please is there a callback function when create or validate is done?

CocoaPods Provides Old Version Instead of the Master Branch

When using

pod 'AppLocker'

I got the Swift 4 version. I have to use

pod 'AppLocker', :git => 'https://github.com/Ryasnoy/AppLocker.git'

to get the Swift 5 version.

Also, you should name the two versions with more suitable tag names, currently all of them are version 2.0 in Xcode.

[RESOLVED]Console warning on "Validate" option

Hi, first, this is a great comprehensive control -- so Thank you! I am seeing a console warning when I try to validate a code: "Cannot be called with asCopy = NO on non-main thread".

Just letting you know.

This is in Xcode 10, b1000 ;)

present full screen iOS 13

 if #available(iOS 13.0, *) {
        locker.isModalInPresentation = true
    } else {
        // Fallback on earlier versions
    }
    locker.modalPresentationStyle = .fullScreen

i need to present applocker fullscreen i add some codes on

class func present(with mode: ALMode, and config: ALAppearance? = nil) {
but still, it's not coming with fullscreen also I changed in xib PresentationStyle = .fullScreen

Passcode lost after phone data transfer

Passcode lost after phone data transfer to other new phone.

try! AppLocker.valet.setString(newValue, forKey: ALConstants.kPincode)

Keychain store value become empty after phone data transfer. How can i retrive passcode or any forgot passcode option available?

Update Swift 5.1?

Is an update possible to 5.1 or even 5? Struggling to run this as it keeps crashing when I 'validate' the code.

[RESOLVED]ALAppearance initializer is inaccessible due to 'internal' protection level

ALAppearance initializer is inaccessible due to 'internal' protection level

2018-05-31 16 48 56

My problems resolved if I add:
"public init" and make "public" all the variables

public struct ALAppearance { // The structure used to display the controller
  public var title: String?
  public var subtitle: String?
  public var image: UIImage?
  public var color: UIColor?
  public var isSensorsEnabled: Bool?
    
  public init() {}
}

Call can throw, but it is not marked with 'try' and the error is not handled

A property savedPin has getter and setter. Shows error like this:
get {
return AppLocker.valet.string(forKey: ALConstants.kPincode) // Error: Call can throw, but it is not marked with 'try' and the error is not handled
}
set {
guard let newValue = newValue else { return }
AppLocker.valet.set(string: newValue, forKey: ALConstants.kPincode) // Error: Call can throw, but it is not marked with 'try' and the error is not handled
}
Is anybody can help to resolve this issue?

[RESOLVED]Appearance

Hi there,

Apologies as I am learning SWIFT (Aren't we all!?) :)

I have implemented the basic appearance exactly as you have in the example - I have even added it a few different ways, but still get the same error.

'Cannot convert value of type 'ALAppearance' to expected argument type 'ALAppearance?''

I have tried cleaning, building, re-connecting the variable, moving the variable definition.

I have currently installed and updated AppLocker via CocoaPods.

Thank you.

J

[RESOLVED]How to validate

I want this to be presented on a custom button and i want to know if the pin is correct or not so is there a delegate or a completion block for this?

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.