|
@@ -12,6 +12,10 @@ import Foundation
|
|
|
|
|
|
typealias EditSubtitleDone = (_ text: String,_ index:Int) -> Void
|
|
|
|
|
|
+
|
|
|
+//字幕最大数限制
|
|
|
+public let subtitleMaxlength:Int = 30
|
|
|
+
|
|
|
class BFSubtitleEditView: UIView {
|
|
|
|
|
|
var showSubtitleIndex = 0
|
|
@@ -21,7 +25,7 @@ class BFSubtitleEditView: UIView {
|
|
|
/// 输入框
|
|
|
lazy var textView: BFTextView = {
|
|
|
let textView = BFTextView()
|
|
|
- textView.maxTextLength = 30
|
|
|
+ textView.maxTextLength = subtitleMaxlength
|
|
|
textView.maxTextLengthRemind = ""
|
|
|
textView.backgroundColor = UIColor.clear
|
|
|
textView.textColor = UIColor.hexColor(hexadecimal: "#FFFFFF")
|
|
@@ -99,7 +103,7 @@ class BFSubtitleEditView: UIView {
|
|
|
|
|
|
func setNewText(text: String,index:Int) {
|
|
|
showSubtitleIndex = index
|
|
|
- textView.text = text.substring(to: 30)
|
|
|
+ textView.text = text.substring(to: subtitleMaxlength)
|
|
|
// BFLog(message: "传值\(textView.text)")
|
|
|
//
|
|
|
// let attributedText = NSMutableAttributedString(string: textView.text,attributes: [.font: UIFont.systemFont(ofSize: CGFloat(settingModel.subtitleSize) * 375 / 1080),.strokeWidth:-6,.strokeColor: settingModel.strokeColor,.foregroundColor:settingModel.fontColor])
|