Giter VIP home page Giter VIP logo

genericpasswordrow's People

Contributors

csr avatar elgartoinf1 avatar jbouaziz avatar jimmyti avatar jobinsjohn avatar kradical avatar mats-claassen avatar microbee23 avatar mtnbarreto avatar nidegen avatar sarbogast avatar yakubbaev 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

genericpasswordrow's Issues

How to fetch real password before revealing it?

What's the best practice to do it?

I found that I have to write a subclass MyGenericPasswordCell of GenericPasswordCell and override the togglePasswordVisibility method. After that, I have to write a MyGenericPasswordRow, _GenericPasswordRow. The Eureka framework is not friendly to add new row type.

Actually, I just make visibilityButton public, and replace the target action.

Eureka 4.0 dependency

Hey, it would be great if the pod spec could require Eureka 4+. I'll look into submitting a PR for that.

CocoaPods could not find compatible versions for pod "Eureka"

Hello,

I wanted to integrate GenericPasswordRow to my project, but cocoapods
displays this message :

`[!] CocoaPods could not find compatible versions for pod "Eureka":
In snapshot (Podfile.lock):
Eureka (= 5.2.1, ~> 5.0)

In Podfile:
Eureka

GenericPasswordRow was resolved to 1.0.0, which depends on
  Eureka (~> 1.7)

`

Could you please update the project to the latest Eureka framework version 5.2.1 please ?

I cannot update myself, because I'm a beginner.

Thank you in advance.

Bug: Infinite loop blocking main thread when password fills the width of the label.

The title is pretty descriptive, but the issue is pretty easy to reproduce, just create a GenericPasswordRow with a customized password validator. When you try to type the password and it's long enough to fill the width of the field, main thread gets stuck, see traceback and screenshots below:

Form:

<<< GenericPasswordRow("user_password"){
  row in
  row.passwordValidator = CustomPasswordValidator()
  row.placeholder = NSLocalizedString("Password", comment: "Password")
  let passwordValidation = RuleClosure<String> { rowValue in
    return ((rowValue == nil) || !(self.form.values()["user_mail"] as? String == rowValue.value)) ? ValidationError(msg: NSLocalizedString("Wrong Password", comment: "Wrong Password Mail")) : nil
  }
  row.add(rule: passwordValidation)
}

Validator:

class CustomPasswordValidator: PasswordValidator {
    
    fileprivate struct PasswordRule {
        
        let hint: String
        let test: (String) -> Bool
    }
    
    open let maxStrength = 5.0
    
    fileprivate let rules: [PasswordRule] = [
        PasswordRule(hint: "Please enter a lowercase letter") { $0.satisfiesRegexp("[a-z]") },
        PasswordRule(hint: "Please enter a number or a special character") { $0.satisfiesRegexp("(?=.*([0-9]|[^\\w]))") },
        PasswordRule(hint: "Please enter an uppercase letter") { $0.satisfiesRegexp("[A-Z]") },
        PasswordRule(hint: "At least 8 characters") { $0.characters.count > 7 },
        PasswordRule(hint: "No more than two consecutive repeating characters or numbers") { $0.satisfiesRegexp("^(?!.*(.)\\1{1})") }
        
    ]
    
    internal func strengthForPassword(_ password: String) -> Double {
        return rules.reduce(0) { $0 + ($1.test(password) ? 1 : 0) }
    }
    
    internal func hintForPassword(_ password: String) -> String? {
        return rules.reduce([]) { $0 + ($1.test(password) ? []: [$1.hint]) }.first
    }
    
    internal func isPasswordValid(_ password: String) -> Bool {
        return rules.reduce(true) { $0 && $1.test(password) }
    }
    
    internal func colorsForStrengths() -> [Double: UIColor] {
        return [
            0: UIColor(red: 244 / 255, green: 67 / 255, blue: 54 / 255, alpha: 1),
            1: UIColor(red: 255 / 255, green: 193 / 255, blue: 7 / 255, alpha: 1),
            2: UIColor(red: 3 / 255, green: 169 / 255, blue: 244 / 255, alpha: 1),
            3: UIColor(red: 153 / 255, green: 255 / 255, blue: 153 / 255, alpha: 1),
            4: UIColor(red: 139 / 255, green: 195 / 255, blue: 74 / 255, alpha: 1)
        ]
    }
    
}

extension String {
    
    func satisfiesRegexp(_ regexp: String) -> Bool {
        return range(of: regexp, options: .regularExpression) != nil
    }
    
}

Main Thread Stack:
MainThreadStack

Stuck at:
Here!

P.D.: Commenting out both beginUpdates() and endUpdates() do not fix the issue, getting stuck at an unknown traceable point of execution.

EDIT: It seems that something that I can't properly debug allocates (after 30 seconds of blocking the Main Thread as I described) up to 1GB of RAM before getting:
Message from debugger: Terminated due to memory issue

How to use Eureka Cell behavior by inherit from _FieldCell in my custom Cell class

Hello guys :)

I notice that GenericPasswordCell inherit from _FieldCell,to take advantage of keyboard handle(eg: automatic keyboard‘s expand/collapse and return button with Eureka)

I also notice in GenericPasswordCell.xib,The only textField instead of bind with GenericPasswordCell,it bind with textField in _FieldCell.How to do that???

I try do the same (bind my textField to _FieldCell in IB),but can not be successful!

2018-02-18 15 42 55

How can I bind textField in my custom Cell to take advantage of keyboard handle from _FieldCell class???

thanks a lot!

How to let Eureka trigger onChange() event on my custom Row?

Hello everyone ;)

I post the Q in stack stackoverflow at here :

https://stackoverflow.com/questions/48866055/how-to-let-eureka-trigger-onchange-event-on-my-custom-row

Can anyone help me??? Thanks a lot.

Q details:

I write a custom Row , and Row's value is this :

struct CountUnit:Equatable,InputTypeInitiable{

    var totalCount:Int
    var unit:String

    init?(string stringValue: String) {
        //...
    }

    static func ==(lhs: CountUnit, rhs: CountUnit) -> Bool {
        //...
    }
}

What I ask is that : How to let Eureka invoke onChange() event on any of CountUnit's instance value changed???(totalCount and unit) :

<<< CountUnitRow() {row in
    //do some init...
}.onChange {row in
    //how to let user know value was changed
}

Thanks a lot ;)

Changing background color

Hey, the standard way of changing the background color of the content cell does not work on PasswordRow.

dark_quotes_xcworkspace

.cellSetup { cell, row in cell.backgroundColor = .blue }

Crashing on IOS 12

I am getting this error on iOS 12:

'Could not load NIB in bundle: 'NSBundle </var/containers/Bundle/Application/F0AAD157-7E76-4F0C-9ED2-336FDC1D0092/FamClub.app> (loaded)' with name 'GenericPasswordCell''

It seems like something in this framweork has broken or is not supported in iOS 12.

Anyone else experiencing this?

no frameworks

The eureka framework cannot be found when I download this project. can you fix that.

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.