Skip to content

Commit

Permalink
U aes密码设置提示
Browse files Browse the repository at this point in the history
U aes密码设置提示
  • Loading branch information
DamonHu committed Dec 26, 2019
1 parent 449b9fc commit 82a7e13
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions HDWindowLoggerSwift/HDWindowLoggerSwift/HDWindowLoggerSwift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ public class HDWindowLoggerItem {
public class HDWindowLoggerSwift: UIWindow, UITableViewDataSource, UITableViewDelegate, UISearchBarDelegate, UITextFieldDelegate {
public static var mCompleteLogOut = true //是否完整输出日志文件名等调试内容
public static var mDebugAreaLogOut = true //是否在xcode底部的调试栏同步输出内容
public static var mPrivacyPassword = "" //解密隐私数据的密码,默认为空不加密
public static var mPrivacyPassword = "" {
willSet {
if newValue.count != kCCKeySizeAES256 {
HDErrorLog(NSLocalizedString("密码设置长度错误,需要32个字符", comment: ""))
}
}
} //解密隐私数据的密码,默认为空不加密
public static let defaultWindowLogger = HDWindowLoggerSwift(frame: CGRect.zero)
public private(set) var mLogDataArray = [HDWindowLoggerItem]()

Expand Down Expand Up @@ -265,9 +271,10 @@ public class HDWindowLoggerSwift: UIWindow, UITableViewDataSource, UITableViewDe
}

//MAKR:UITextFieldDelegate
public func textFieldDidEndEditing(_ textField: UITextField) {
public func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.resignFirstResponder()
self.p_decrypt()
return true
}

//MARK:UITableViewDelegate
Expand Down Expand Up @@ -422,6 +429,8 @@ public class HDWindowLoggerSwift: UIWindow, UITableViewDataSource, UITableViewDe

//解密
@objc private func p_decrypt() {
self.mPasswordTextField.resignFirstResponder()
self.mSearchBar.resignFirstResponder()
if self.mPasswordTextField.text != nil {
self.mTableView.reloadData()
}
Expand Down
2 changes: 1 addition & 1 deletion HDWindowLoggerSwift/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ViewController: UIViewController {
//配置HDWindowLoggerSwift
HDWindowLoggerSwift.show()
HDWindowLoggerSwift.mCompleteLogOut = true
HDWindowLoggerSwift.mPrivacyPassword = "123456" //设置加密内容密码
HDWindowLoggerSwift.mPrivacyPassword = "12345678901234561234567890123456" //设置加密内容密码
}

@objc func onClickButton() {
Expand Down

0 comments on commit 82a7e13

Please sign in to comment.