This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | override init(frame: CGRect) { | |
| super.init(frame: frame) | |
| /// Preparing UIView | |
| prepareUIView() | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | fileprivate var verticalStackView: UIStackView = { | |
| let stackView: UIStackView = UIStackView() | |
| stackView.translatesAutoresizingMaskIntoConstraints = false | |
| stackView.isUserInteractionEnabled = false | |
| stackView.alignment = .center | |
| stackView.axis = .vertical | |
| stackView.distribution = .equalCentering | |
| return stackView | |
| }() | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | var lblSubTitle: UILabel = { | |
| var lbl: UILabel = UILabel() | |
| lbl.translatesAutoresizingMaskIntoConstraints = false | |
| lbl.backgroundColor = .clear | |
| lbl.textAlignment = .center | |
| lbl.adjustsFontSizeToFitWidth = true | |
| lbl.minimumScaleFactor = 0.75 | |
| lbl.textColor = .darkGray | |
| lbl.font = .systemFont(ofSize: UIFont.smallSystemFontSize) | |
| return lbl | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /// Variable Declaration(s) | |
| var lblTitle: UILabel = { | |
| var lbl: UILabel = UILabel() | |
| lbl.translatesAutoresizingMaskIntoConstraints = false | |
| lbl.backgroundColor = .clear | |
| lbl.textAlignment = .center | |
| lbl.adjustsFontSizeToFitWidth = true | |
| lbl.minimumScaleFactor = 0.75 | |
| lbl.textColor = .darkText | |
| lbl.font = .boldSystemFont(ofSize: UIFont.systemFontSize) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /// LocalAuthentication | |
| class LocalAuthentication: NSObject { | |
| /// Variable Declaration(s) | |
| class var isFaceIdAvailable: Bool { | |
| let context: LAContext = LAContext() | |
| let evaluate = context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: nil) | |
| if #available(iOS 11.0, *) { | |
| return (context.biometryType == .faceID) | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | fileprivate static func evaluate(_ policy: LAPolicy, reason: String, context: LAContext, block: @escaping authenticationBlock) { | |
| context.evaluatePolicy(policy, localizedReason: reason) { (isSuccess, error) in | |
| block(AuthenticationBlockState.initWith(error as? LAError)) | |
| } | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class func authenticateUserWithBioMetrics(_ reasonMessage: String, cancelTitle: String? = "", block: @escaping authenticationBlock) { | |
| let context: LAContext = LAContext() | |
| context.localizedCancelTitle = cancelTitle | |
| context.localizedFallbackTitle = "Passcode" | |
| evaluate(.deviceOwnerAuthentication, reason: (reasonMessage.isEmpty ? defaultReasonMessage : reasonMessage), context: context, block: block) | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /// Block Declaration(s) | |
| typealias authenticationBlock = ((AuthenticationBlockState) -> ()) |