Commit 3782f95f authored by pete谢兆麟's avatar pete谢兆麟

细节修改

parent 9e266f14
...@@ -18,7 +18,7 @@ import UIKit ...@@ -18,7 +18,7 @@ import UIKit
class YHFileRenameInputView: UIView { class YHFileRenameInputView: UIView {
static let height = 217.0 static let height = 217.0
static let maxWordsCount = 30 var maxWordsCount = 30
var editBlock:((String?)->Void)? var editBlock:((String?)->Void)?
lazy var blackMaskView: UIView = { lazy var blackMaskView: UIView = {
let view = UIView(frame:UIScreen.main.bounds) let view = UIView(frame:UIScreen.main.bounds)
...@@ -115,6 +115,9 @@ class YHFileRenameInputView: UIView { ...@@ -115,6 +115,9 @@ class YHFileRenameInputView: UIView {
view.textField.text = defalutText view.textField.text = defalutText
view.textField.attributedPlaceholder = NSAttributedString(string: placeholde, attributes: [NSAttributedString.Key.foregroundColor : UIColor.placeHolderColor]) view.textField.attributedPlaceholder = NSAttributedString(string: placeholde, attributes: [NSAttributedString.Key.foregroundColor : UIColor.placeHolderColor])
view.titleLabel.text = title view.titleLabel.text = title
if placeholde == "请输入自定义标签" {
view.maxWordsCount = 10
}
return view return view
} }
...@@ -217,9 +220,9 @@ extension YHFileRenameInputView: UITextFieldDelegate { ...@@ -217,9 +220,9 @@ extension YHFileRenameInputView: UITextFieldDelegate {
return true return true
} }
var newText = (textField.text! as NSString).replacingCharacters(in: range, with: string) let newText = (textField.text! as NSString).replacingCharacters(in: range, with: string)
if newText.count > Self.maxWordsCount { if newText.count > self.maxWordsCount {
YHHUD.flash(message: "重命名限制最多30个字符") YHHUD.flash(message: "重命名限制最多\(maxWordsCount)个字符")
return false return false
} }
return true return true
......
...@@ -58,7 +58,6 @@ class YHEditInterestViewController: YHBaseViewController { ...@@ -58,7 +58,6 @@ class YHEditInterestViewController: YHBaseViewController {
let layout = YHSearchItemLayout() let layout = YHSearchItemLayout()
layout.scrollDirection = .vertical layout.scrollDirection = .vertical
layout.minimumInteritemSpacing = 12 layout.minimumInteritemSpacing = 12
// 创建集合视图 // 创建集合视图
let collectView = UICollectionView(frame:.zero, collectionViewLayout: layout) let collectView = UICollectionView(frame:.zero, collectionViewLayout: layout)
collectView.delegate = self collectView.delegate = self
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment