AppLocker icon indicating copy to clipboard operation
AppLocker copied to clipboard

BackgroundColor of pinview indicator rectangle!

Open wolf85-prog opened this issue 3 years ago • 1 comments

When filling in the pin code, the indicator will not be round but square.

wolf85-prog avatar Nov 07 '20 14:11 wolf85-prog

Hi,

I have added two lines to drawing function like below and problem solved!

private func drawing(isNeedClear: Bool, tag: Int? = nil) { // Fill or cancel fill for indicators

    let results = pinIndicators.filter { $0.isNeedClear == isNeedClear }
    let pinView = isNeedClear ? results.last : results.first
    pinView?.isNeedClear = !isNeedClear
    
    pinView?.layer.cornerRadius = 0.5 * (pinView?.bounds.size.width)! // add these lines
    pinView?.clipsToBounds = true
    
    UIView.animate(withDuration: ALConstants.duration, animations: {
        pinView?.backgroundColor = isNeedClear ? .clear : .white
    }) { _ in
        isNeedClear ? self.pin = String(self.pin.dropLast()) : self.pincodeChecker(tag ?? 0)
    }
}

ensarbayhan avatar Jan 28 '21 12:01 ensarbayhan