case first
/// 主标题 - 0x333333
case primary
- /// 二级标题 - 0x666666
+ /// 二级标题
case secondary
- /// 三级标题 - 0x999999
+ /// 三级标题
case tertiary
+ case placeholder
+
case separateLine
case cellBg
return 0x666666
case .tertiary:
return 0x999999
+ case .placeholder:
+ return 0xcccccc
case .separateLine:
return 0xffffff
case .cellBg:
case .first:
return 0xffffff
case .primary:
- return 0x333333
+ return 0xffffff
case .secondary:
- return 0x666666
+ return 0x999999
case .tertiary:
return 0x999999
+ case .placeholder:
+ return 0x666666
case .separateLine:
- return 0xffffff
+ return 0x666666
case .cellBg:
return 0x242424
}
}
func authSuccessCallback() {
Logger.debug("鉴权成功")
+ guard let device = CCBleManager.shared.connectPeripheral else { return }
CCAiManager.preparePlayBlueTooth()
- DeviceCache.saveLastConnected(mac: CCBleManager.shared.connectPeripheral!.mac)
+ DeviceCache.saveLastConnected(mac: device.mac)
DeviceCache.shared.add(CCBleManager.shared.connectPeripheral!.device.identifier.uuidString, mac: CCBleManager.shared.connectPeripheral!.mac)
CCBleManager.shared.isConnetd = true
CCBleManager.shared.didConnectDeviceCallback?(CCBleManager.shared.connectPeripheral!)
tipsLabel.do { v in
v.text = "内容由AI生成,请仔细甄别".l10n
v.font = .regular(10)
- v.textColor = .hexString("#919191")
+ v.textColor = .color(.placeholder)
}
}
override func setupLayout() {
}
override func setupViews() {
navBar.title = "通话录音".l10n
- navBar.backgroundColor = .white
+ navBar.backgroundColor = .clear
toolBar.do { v in
}
- view.backgroundColor = .white
+ view.backgroundColor = .color(.bgColor)
// rhythView.backgroundColor = .blue
selfTextView.do { v in
- v.backgroundColor = .white
+ v.backgroundColor = .clear
v.isEditable = false
v.font = .regular(14)
v.text = ""
// v.backgroundColor = .green
}
otherTextView.do { v in
- v.backgroundColor = .white
+ v.backgroundColor = .clear
v.isEditable = false
v.font = .regular(14)
v.text = ""
textView.do { v in
v.placeHolde = "此处将显示原文".l10n
- v.textView.textColor = .hexString("#666666")
+ v.textView.textColor = .color(.secondary)
}
translateTextView.do { v in
v.textView.textColor = .color(.first)
override func setupViews() {
navBar.title = "现场录音".l10n
- navBar.backgroundColor = .white
+ navBar.backgroundColor = .clear
toolBar.do { v in
v.delegate = self
v.leftItem.language = AiLanguageCache.get(type: .xcly) ?? .chinse
}
- view.backgroundColor = .white
+ view.backgroundColor = .color(.bgColor)
textView.do { v in
v.isEditable = false
v.font = .regular(14)
v.text = ""
- v.backgroundColor = .white
+ v.backgroundColor = .clear
v.textColor = .color(.first)
v.contentInset = UIEdgeInsets(top: 0, left: 18, bottom: 0, right: 18)
}
textView.do { v in
v.placeHolde = "此处将显示原文".l10n
- v.textView.textColor = .hexString("#666666")
+ v.textView.textColor = .color(.secondary)
}
translateTextView.do { v in
v.textView.textColor = .color(.first)
// v.textAlignment = .left
// v.numberOfLines = 0
// v.font = .regular(12)
-// v.textColor = .rgb(0x666666)
+// v.textColor = .color(.secondary)
// }
// selectButton.do { (v) in
// v.yc.setBorder(width: 1.fitR, color: .rgb(0x999999), radius: 2.fitR)
for item in vm.list {
let label = HeaderCell()
label.text = item.title
- label.textColor = .hexString("#666666")
+ label.textColor = .color(.secondary)
label.font = .regular(14)
label.numberOfLines = 0
label.width = kScreenWid - 140
// if item !== vm.list.last {
// let line = UIView()
-// line.backgroundColor = .hexString("#F2F2F2")
+// line.backgroundColor = .hexString("#.color(.separateLine)")
// line.height = 1
// line.width = kScreenWid - 2*70
// line.left = 10
addSubviews([titleLabel])
titleLabel.do { (v) in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(14)
v.textAlignment = .left
v.numberOfLines = 0
}
originalLabel.do { v in
v.font = .regular(14)
- v.textColor = .hexString("#606D80")
+ v.textColor = .color(.first)
v.numberOfLines = 0
v.textAlignment = .left
}
toolBar.do { v in
v.textField.text = ""
v.delegate = self
- v.textField.placeholder = "请用一句话简单描述下您的问题~".l10n
+ v.textField.attributedPlaceholder = NSAttributedString(string: "请用一句话简单描述下您的问题~".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
+
// v.backgroundColor = .green
}
qaView.do { v in
override func setupViews() {
// backgroundColor = .red
bgView.do { v in
- v.backgroundColor = .white
+ v.backgroundColor = .color(.cellBg)
v.yc.setCornerRadius(12)
}
titleLabel.do { (v) in
contentView.addSubviews([titleLabel])
titleLabel.do { (v) in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(14)
v.textAlignment = .left
v.numberOfLines = 0
}
override func setupViews() {
- contentView.backgroundColor = .rgb(0xF6F6F6)
+ contentView.backgroundColor = .clear
+ backgroundView?.backgroundColor = .clear
+ backgroundColor = .clear
bgView.do { v in
v.yc.setCornerRadius(12)
originalLabel.do { v in
v.text = "你好,欢迎使用AI翻译,点击下方按钮立即开始咱们的对话吧".l10n
v.font = .medium(14)
- v.textColor = .hexString("#606D80")
+ v.textColor = .color(.first)
v.numberOfLines = 0
v.textAlignment = .left
}
}
}
else{
- bgView.backgroundColor = .white
+ bgView.backgroundColor = .color(.cellBg)
originalLabel.textColor = .color(.first)
bgView.snp.remakeConstraints { make in
v.text = "我可以帮你搜索、答疑、写作,请把你的任务交给 我吧~".l10n
v.numberOfLines = 0
v.textAlignment = .center
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
v.font = .bold(14)
}
}
cancelLabel.isHidden = true
}
else{
- animationBg.backgroundColor = .white
+ animationBg.backgroundColor = .color(.cellBg)
animationView.isHidden = true
animationView.isHidden = true
titleLabel.isHidden = state != .finish
titleLabel.text = "按住说话".l10n
}
cancelLabel.do { v in
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
v.font = .regular(12)
v.textAlignment = .center
v.text = "松手发送,上移取消".l10n
animationBg.do { v in
v.yc.setCornerRadius(16)
- animationBg.backgroundColor = .white
+ animationBg.backgroundColor = .color(.bgColor)
}
animationView.kf.setImage(with: Bundle.main.url(forResource: "dialog_record", withExtension: "gif")!)
titleLabel.isHidden = false
cancelLabel.isHidden = true
- animationBg.backgroundColor = .white
+ animationBg.backgroundColor = .color(.cellBg)
animationView.isHidden = true
animationView.isHidden = true
}
}
selectedIcon.image = UIImage(named: "cell_selected")
line.do { v in
- v.backgroundColor = .hexString("#F2F2F2")
+ v.backgroundColor = .color(.separateLine)
}
}
}
override func setupViews() {
- contentView.backgroundColor = .rgb(0xF6F6F6)
+ contentView.backgroundColor = .clear
+ backgroundView?.backgroundColor = .clear
+ backgroundColor = .clear
bgView.do { v in
v.yc.setCornerRadius(12)
- v.backgroundColor = .white
+ v.backgroundColor = .color(.cellBg)
}
originalLabel.do { v in
v.font = .regular(14)
- v.textColor = .hexString("#606D80")
+ v.textColor = .color(.first)
v.numberOfLines = 0
v.textAlignment = .left
}
v.textAlignment = .left
}
line.do { v in
-// v.backgroundColor = .hexString("#93C6EC")
}
playIcon.do { v in
v.image = UIImage(named: "play_animate_3")
v.textAlignment = .left
}
deviceLabel.do { (v) in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(14)
v.textAlignment = .left
v.text = "共4个智能设备"
v.font = .bold(16)
}
valueLabel.do { v in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(10)
}
}
make.left.equalToSuperview().inset(18)
}
bgView.backgroundColor = .white
- originalLabel.textColor = .hexString("#606D80")
+ originalLabel.textColor = .color(.first)
}
}
else{
make.left.equalToSuperview().inset(18)
}
bgView.backgroundColor = .white
- originalLabel.textColor = .hexString("#606D80")
+ originalLabel.textColor = .color(.first)
}
}
}
}
override func setupViews() {
- contentView.backgroundColor = .color(.bgColor)
+ contentView.backgroundColor = .clear
+ backgroundView?.backgroundColor = .clear
+ backgroundColor = .clear
bgView.do { v in
v.yc.setCornerRadius(12)
- v.backgroundColor = .white
+ v.backgroundColor = .color(.cellBg)
}
originalLabel.do { v in
v.font = .regular(14)
- v.textColor = .hexString("#606D80")
+ v.textColor = .color(.first)
v.numberOfLines = 0
v.textAlignment = .left
}
v.textAlignment = .left
}
line.do { v in
-// v.backgroundColor = .hexString("#93C6EC")
}
playIcon.do { v in
v.image = UIImage(named: "play_animate_3")
// make.width.equalTo(kScreenWid - 78)
make.left.equalToSuperview().inset(18)
}
- bgView.backgroundColor = .white
- originalLabel.textColor = .hexString("#606D80")
+ bgView.backgroundColor = .color(.cellBg)
+ originalLabel.textColor = .color(.first)
translationLabel.textColor = .color(.first)
}
line.setNeedsLayout()
var hasRightItem:Bool = true
override func setupViews() {
- backgroundColor = .white
+ backgroundColor = .color(.cellBg)
addSubviews([leftItem,rightItem,recordBtn])
recordBtn.do { v in
v.font = .bold(16)
}
valueLabel.do { v in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(10)
v.text = "耳机".l10n
}
override func setupViews() {
addSubviews([titleLabel])
titleLabel.do { (v) in
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
v.font = .regular(14)
v.numberOfLines = 0
bgView.addGestureRecognizer(longTap)
}
titleLabel.do { (v) in
- v.textColor = .rgb(0x121212)
+ v.textColor = .color(.first)
v.font = .bold(16)
v.textAlignment = .left
v.text = "周一会议总结"
}
durationLabel.do { (v) in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(12)
v.textAlignment = .left
v.text = "00:32:27"
}
typeLabel.do { (v) in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(12)
v.textAlignment = .left
v.text = "现场录音"
}
dateLabel.do { (v) in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(12)
v.textAlignment = .left
v.text = "2025-06-02 10:28"
cancelBtn.do { v in
v.setTitle("取消".l10n, for: .normal)
- v.setTitleColor(.rgb(0x666666), for: .normal)
+ v.setTitleColor(.color(.secondary), for: .normal)
v.titleLabel?.font = .regular(14)
v.addTarget(self, action: #selector(cancelAction), for: .touchUpInside)
// v.backgroundColor = .yellow
textField.do { v in
v.clearButtonMode = .whileEditing
v.backgroundColor = .clear
- v.placeholder = "搜索".l10n
+ v.attributedPlaceholder = NSAttributedString(string: "搜索".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
v.returnKeyType = .done
v.delegate = self
v.addTarget(self, action: #selector(textFieldDidChange(_:)), for: .editingChanged)
selectedIcon.image = UIImage(named: "cell_selected")
line.do { v in
- v.backgroundColor = .hexString("#F2F2F2")
+ v.backgroundColor = .hexString("#.color(.separateLine)")
}
}
override func setupViews() {
addSubviews([titleLabel])
titleLabel.do { (v) in
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
v.font = .regular(14)
v.numberOfLines = 0
v.text = "周一会议总结"
}
durationLabel.do { (v) in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(12)
v.textAlignment = .left
v.text = "00:32:27"
}
typeLabel.do { (v) in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(12)
v.textAlignment = .left
v.text = "现场录音"
}
dateLabel.do { (v) in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(12)
v.textAlignment = .left
v.text = "2025-06-02 10:28"
let leftLabel = UILabel()
leftLabel.text = "全选".l10n
- leftLabel.textColor = .hexString("#666666")
- leftLabel.yc.setBorder(width: 1, color: .hexString("#666666"), radius: 11)
+ leftLabel.textColor = .color(.secondary)
+ leftLabel.yc.setBorder(width: 1, color: .color(.secondary), radius: 11)
leftLabel.font = .regular(12)
leftLabel.textAlignment = .center
leftLabel.yc.addTap(target: self, action: #selector(allSelctedAction))
tempList.append(item.model)
}
}
+ if tempList.count == 0 {
+ return
+ }
App.shared.goToPage(RecordShareVC(cloudList: tempList))
}
@objc func deleteAction(){
v.layer.masksToBounds = true
}
titleLabel.do { (v) in
- v.textColor = .rgb(0x121212)
+ v.textColor = .color(.first)
v.font = .bold(16)
v.textAlignment = .left
v.text = "周一会议总结"
}
durationLabel.do { (v) in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(12)
v.textAlignment = .left
v.text = "00:32:27"
}
typeLabel.do { (v) in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(12)
v.textAlignment = .left
v.text = "现场录音"
}
dateLabel.do { (v) in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(12)
v.textAlignment = .left
v.text = "2025-06-02 10:28"
let leftLabel = UILabel()
leftLabel.text = "全选"
- leftLabel.textColor = .hexString("#666666")
- leftLabel.yc.setBorder(width: 1, color: .hexString("#666666"), radius: 11)
+ leftLabel.textColor = .color(.secondary)
+ leftLabel.yc.setBorder(width: 1, color: .color(.secondary), radius: 11)
leftLabel.font = .regular(12)
leftLabel.textAlignment = .center
leftLabel.yc.addTap(target: self, action: #selector(allSelctedAction))
tempList.append(item.model)
}
}
+ if tempList.count == 0 {
+ return
+ }
App.shared.goToPage(RecordShareVC(localList: tempList))
}
@objc func deleteAction(){
label.do { (v) in
v.font = .medium(14)
v.textAlignment = .center
- v.backgroundColor = .clear
+ v.backgroundColor = .color(.cellBg)
v.textColor = .color(.theme)
}
}
timeLabel.do { (v) in
v.font = .regular(14)
v.textAlignment = .center
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
v.text = data.createTime
}
originView.do { v in
v.numberOfLines = 0
}
valueLabel.do { (v) in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(13)
v.textAlignment = .left
v.numberOfLines = 0
}
override func setupViews() {
- contentView.backgroundColor = .rgb(0xF6F6F6)
+ contentView.backgroundColor = .clear
+ backgroundView?.backgroundColor = .clear
+ backgroundColor = .clear
bgView.do { v in
v.yc.setCornerRadius(12)
- v.backgroundColor = .white
+ v.backgroundColor = .color(.cellBg)
}
originalLabel.do { v in
v.font = .regular(14)
- v.textColor = .hexString("#606D80")
+ v.textColor = .color(.first)
v.numberOfLines = 0
v.textAlignment = .left
}
v.textAlignment = .left
}
line.do { v in
- // v.backgroundColor = .hexString("#93C6EC")
}
copyIcon.do { v in
v.image = UIImage(named: "copy_icon")
tipsLabel.do { v in
v.numberOfLines = 0
v.font = .medium(22)
- v.textColor = .rgb(0x121212)
+ v.textColor = .color(.first)
let text = "您好, \n欢迎使用DeepChords".l10n
let stype = NSMutableParagraphStyle()
stype.lineSpacing = 10
}
bgView.do { v in
- v.backgroundColor = .white
+ v.backgroundColor = .color(.bgColor)
v.yc.setCorners(withRoundedRect: CGRect(x: 0, y: 0, width: kScreenWid, height: kScreenHei - 244), roundingCorners: [.topLeft,.topRight], cornerRadii: CGSize(width: 50, height: 50))
}
titleLabel.do { v in
v.textColor = .color(.first)
}
phoneView.do { v in
- v.textField.placeholder = "请输入手机号码/邮箱".l10n
+ v.textField.attributedPlaceholder = NSAttributedString(string: "请输入手机号码/邮箱".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
v.textField.keyboardType = .emailAddress
}
codeView.do { v in
v.codeButton.addTarget(self, action: #selector(codeButtonAction), for: .touchUpInside)
}
pwdView.do { v in
- v.textField.placeholder = "请输入密码".l10n
+ v.textField.attributedPlaceholder = NSAttributedString(string: "请输入密码".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
}
loginBtn.set(title: "确认".l10n,style: .theme1, target: self, action: #selector(loginAction))
agreeView.isHidden = true
tipsLabel.do { v in
v.numberOfLines = 0
v.font = .medium(22)
- v.textColor = .rgb(0x121212)
+ v.textColor = .color(.first)
let text = "您好, \n欢迎使用DeepChords".l10n
let stype = NSMutableParagraphStyle()
stype.lineSpacing = 10
}
bgView.do { v in
- v.backgroundColor = .white
+ v.backgroundColor = .color(.bgColor)
v.yc.setCorners(withRoundedRect: CGRect(x: 0, y: 0, width: kScreenWid, height: kScreenHei - 244), roundingCorners: [.topLeft,.topRight], cornerRadii: CGSize(width: 50, height: 50))
}
titleLabel.do { v in
}
phoneView.do { v in
// v.textField.text = "13480939445"
- v.textField.placeholder = "请输入手机号码/邮箱".l10n
+ v.textField.attributedPlaceholder = NSAttributedString(string: "请输入手机号码/邮箱".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
v.textField.keyboardType = .emailAddress
}
pwdView.do { v in
- v.textField.placeholder = "请输入密码".l10n
+ v.textField.attributedPlaceholder = NSAttributedString(string: "请输入密码".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
+
}
loginBtn.set(title: "登录".l10n,style: .theme1, target: self, action: #selector(loginAction))
tipsLabel.do { v in
v.numberOfLines = 0
v.font = .medium(22)
- v.textColor = .rgb(0x121212)
+ v.textColor = .color(.first)
let text = "您好, \n欢迎使用DeepChords".l10n
let stype = NSMutableParagraphStyle()
stype.lineSpacing = 10
}
bgView.do { v in
- v.backgroundColor = .white
+ v.backgroundColor = .color(.bgColor)
v.yc.setCorners(withRoundedRect: CGRect(x: 0, y: 0, width: kScreenWid, height: kScreenHei - 244), roundingCorners: [.topLeft,.topRight], cornerRadii: CGSize(width: 50, height: 50))
}
titleLabel.do { v in
}
func updateLayout(){
if regionView.region.isChinese{
- phoneView.textField.placeholder = "请输入手机号码".l10n
+ phoneView.textField.attributedPlaceholder = NSAttributedString(string: "请输入手机号码".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
+
phoneView.textField.keyboardType = .phonePad
}
else{
- phoneView.textField.placeholder = "请输入邮箱".l10n
+ phoneView.textField.attributedPlaceholder = NSAttributedString(string: "请输入邮箱".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
phoneView.textField.keyboardType = .emailAddress
}
}
v.textColor = .color(.first)
}
phoneView.do { v in
- v.textField.placeholder = "请输入邮箱地址".l10n
+ v.textField.attributedPlaceholder = NSAttributedString(string: "请输入邮箱".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
+
v.textField.keyboardType = .emailAddress
}
loginBtn.set(title: "下一步".l10n,style: .theme1, target: self, action: #selector(loginAction))
v.textColor = .color(.first)
}
pwdView1.do { v in
- v.textField.placeholder = "请输入密码".l10n
+ v.textField.attributedPlaceholder = NSAttributedString(string: "请输入密码".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
+
}
pwdView2.do { v in
- v.textField.placeholder = "请输入确认密码".l10n
+ v.textField.attributedPlaceholder = NSAttributedString(string: "请输入确认密码".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
+
}
desLabel.do { v in
v.text = "密码长度8-16位,数字、字母、字符至少包含两种".l10n
tipsLabel.do { v in
v.numberOfLines = 0
v.font = .medium(22)
- v.textColor = .rgb(0x121212)
+ v.textColor = .color(.first)
let text = "您好, \n欢迎使用DeepChords".l10n
let stype = NSMutableParagraphStyle()
stype.lineSpacing = 10
}
bgView.do { v in
- v.backgroundColor = .white
+ v.backgroundColor = .color(.bgColor)
v.yc.setCorners(withRoundedRect: CGRect(x: 0, y: 0, width: kScreenWid, height: kScreenHei - 244), roundingCorners: [.topLeft,.topRight], cornerRadii: CGSize(width: 50, height: 50))
}
titleLabel.do { v in
}
func updateLayout(){
if regionView.region.isChinese{
- phoneView.textField.placeholder = "请输入手机号码".l10n
+ phoneView.textField.attributedPlaceholder = NSAttributedString(string: "请输入手机号码".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
+
phoneView.textField.keyboardType = .phonePad
}
else{
- phoneView.textField.placeholder = "请输入邮箱".l10n
+ phoneView.textField.attributedPlaceholder = NSAttributedString(string: "请输入邮箱".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
+
phoneView.textField.keyboardType = .emailAddress
}
}
v.addTarget(self, action: #selector(agreeBtnAction), for: .touchUpInside)
}
agreeTitle.do { (v) in
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
v.font = .regular(12)
v.textAlignment = .left
v.text = "登录并同意".l10n
v.add(target: self, action: #selector(agreementAction))
}
andlabel.do { (v) in
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
v.font = .regular(12)
v.textAlignment = .left
v.text = " 和 ".l10n
override func setupViews() {
// backgroundColor = .red
textField.do { v in
- v.textColor = .black
+ v.textColor = .color(.first)
v.keyboardType = .phonePad
- v.placeholder = "请输入验证码".l10n
+ v.attributedPlaceholder = NSAttributedString(string: "请输入验证码".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
+
}
codeButton.do { (v) in
v.maxCount = 60
v.label.text = "点击获取".l10n
}
- inputBgView.backgroundColor = .rgb(0xF3F4F8)
+ inputBgView.backgroundColor = .color(.cellBg)
inputBgView.layer.cornerRadius = 12
inputBgView.layer.masksToBounds = true
}
func addRightLine(height:Float){
let line = UIView()
- line.backgroundColor = .hexString("#666666")
+ line.backgroundColor = .color(.secondary)
addSubview(line)
line.snp.makeConstraints { make in
make.height.equalTo(height)
}
func addBottomLine(){
let line = UIView()
- line.backgroundColor = .hexString("#F2F2F2")
+ line.backgroundColor = .hexString("#.color(.separateLine)")
addSubview(line)
line.snp.makeConstraints { make in
make.height.equalTo(1)
// backgroundColor = .red
textField.do { v in
- v.textColor = .black
+ v.textColor = .color(.first)
v.keyboardType = .phonePad
- v.placeholder = "请输入手机号码".l10n
-
+ v.attributedPlaceholder = NSAttributedString(string: "请输入手机号码".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
+
let label = UILabel()
- label.textColor = .hexString("#666666")
+ label.textColor = .color(.secondary)
label.font = .medium(16)
let imageAtt = NSTextAttachment()
imageAtt.image = UIImage(named: "arrow_next")
v.leftViewMode = .never
}
- inputBgView.backgroundColor = .rgb(0xF3F4F8)
+ inputBgView.backgroundColor = .color(.cellBg)
inputBgView.layer.cornerRadius = 10
inputBgView.layer.masksToBounds = true
addSubviews([inputBgView])
// backgroundColor = .red
addSubviews([toolView,thirdView])
toolView.addSubviews([registerLabel,pwdLabel,smsLabel,line1,line2])
- line1.backgroundColor = .hexString("#666666")
- line2.backgroundColor = .hexString("#666666")
+ line1.backgroundColor = .color(.secondary)
+ line2.backgroundColor = .color(.secondary)
registerLabel.do { v in
v.text = "注册".l10n
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
v.font = .regular(12)
v.textAlignment = .center
v.yc.addTap(target: self, action: #selector(registerAction))
}
pwdLabel.do { v in
v.text = "忘记密码".l10n
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
v.font = .regular(12)
v.textAlignment = .center
v.yc.addTap(target: self, action: #selector(forgetAction))
}
smsLabel.do { v in
v.text = "验证码登录".l10n
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
v.font = .regular(12)
v.textAlignment = .center
v.yc.addTap(target: self, action: #selector(smsAction))
label.do { v in
v.text = "其他登录方式".l10n
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
v.font = .regular(12)
v.textAlignment = .center
}
// backgroundColor = .red
textField.do { v in
- v.textColor = .black
+ v.textColor = .color(.first)
v.keyboardType = .default
- v.placeholder = "请输入密码".l10n
+ v.attributedPlaceholder = NSAttributedString(string: "请输入密码".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
v.isSecureTextEntry = true
// v.returnKeyType = .done
}
textField.rightView = btn
textField.rightViewMode = .always
- inputBgView.backgroundColor = .rgb(0xF3F4F8)
+ inputBgView.backgroundColor = .color(.cellBg)
inputBgView.layer.cornerRadius = 10
inputBgView.layer.masksToBounds = true
addSubviews([inputBgView])
addSubviews([inputBgView])
inputBgView.addSubviews([titleLabel,valeLabel,arrrowIcon])
- inputBgView.backgroundColor = .rgb(0xF3F4F8)
+ inputBgView.backgroundColor = .color(.cellBg)
inputBgView.layer.cornerRadius = 10
inputBgView.layer.masksToBounds = true
inputBgView.yc.addTap(target: self, action: #selector(tapAction))
titleLabel.do { v in
v.text = "国家/地区".l10n
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
v.font = .medium(16)
v.textAlignment = .center
}
v.image = UIImage(named: "logo_1")
}
titleLabel.do { (v) in
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
v.font = .regular(14)
v.textAlignment = .left
v.text = "当前版本".l10n + ":\(Bundle.main.appVersion ?? "") "
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = CustomSectionHeader.header(withTableView: tableView)
view.titleLabel.text = list[section].title
- view.titleLabel.textColor = .hexString("#666666")
+ view.titleLabel.textColor = .color(.secondary)
return view
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
v.textAlignment = .left
}
valueLabel.do { (v) in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(14)
v.textAlignment = .left
}
bgView.addSubviews([typeView,contentView,imgView,contactView,loginBtn])
bgView.do { v in
- v.backgroundColor = .white
+ v.backgroundColor = .color(.cellBg)
v.yc.setCornerRadius(12)
}
loginBtn.set(title: "确定".l10n,style: .theme1, target: self, action: #selector(loginAction))
titleLabel.do { v in
v.textAlignment = .center
v.font = .bold(14)
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
v.text = "联系方式".l10n
}
bgView.do { v in
- v.backgroundColor = .hexString("#F7F8F9")
+ v.backgroundColor = .color(.bgColor)
v.yc.setCornerRadius(12)
}
textField.do { v in
- v.placeholder = "请输入手机号或邮箱".l10n
+ v.attributedPlaceholder = NSAttributedString(string: "请输入手机号或邮箱".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
+
v.font = .regular(14)
v.returnKeyType = .done
v.delegate = self
titleLabel.do { v in
v.textAlignment = .center
v.font = .bold(14)
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
v.text = "问题描述或建议".l10n
}
bgView.do { v in
- v.backgroundColor = .hexString("#F7F8F9")
+ v.backgroundColor = .color(.bgColor)
v.yc.setCornerRadius(12)
}
textView.do {v in
titleLabel.do { v in
v.textAlignment = .center
v.font = .bold(14)
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
v.text = "问题类型".l10n
}
errorItem.do { v in
}
else{
titleLabel.textColor = .color(.first)
- backgroundColor = .hexString("#F7F8F9")
+ backgroundColor = .color(.bgColor)
}
}
}
override func setupViews() {
- backgroundColor = .hexString("#F7F8F9")
+ backgroundColor = .color(.bgColor)
addSubviews([titleLabel])
titleLabel.do { v in
v.textAlignment = .center
v.adjustsFontSizeToFitWidth = true
v.font = .regular(14)
+ v.textColor = .color(.first)
v.yc.setCornerRadius(6)
}
}
let line = UIView()
override func setupViews() {
- backgroundColor = .white
+ backgroundColor = .color(.cellBg)
addSubviews([feedbackItem,chatItem,line])
feedbackItem.do { v in
v.icon.image = UIImage(named: "feedback_edit")
}
originalLabel.do { v in
v.font = .regular(14)
- v.textColor = .hexString("#606D80")
+ v.textColor = .color(.first)
v.numberOfLines = 0
v.textAlignment = .left
}
v.lineBreakMode = .byTruncatingTail
}
contentLabel.do { v in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(14)
v.textAlignment = .left
v.lineBreakMode = .byTruncatingTail
var didSelected:((_ model:QaModelListModel)->Void)?
override func setupViews() {
- backgroundColor = .white
+ backgroundColor = .color(.cellBg)
yc.setCornerRadius(12)
tableView.do { v in
v.delegate = self
contentView.addSubviews([titleLabel])
titleLabel.do { (v) in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(14)
v.textAlignment = .left
v.numberOfLines = 0
bgView.do { v in
v.yc.setCornerRadius(8)
- v.backgroundColor = .white
+ v.backgroundColor = .color(.cellBg)
}
textField.do { v in
v.clearButtonMode = .whileEditing
v.backgroundColor = .clear
- v.placeholder = "请输入型号查询".l10n
+ v.attributedPlaceholder = NSAttributedString(string: "请输入型号查询".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
+
v.returnKeyType = .done
v.delegate = self
v.addTarget(self, action: #selector(textFieldDidChange(_:)), for: .editingChanged)
webView.addObserver(self, forKeyPath: "estimatedProgress", options: .new, context: nil)
webView.addObserver(self, forKeyPath: "canGoBack", options: .new, context: nil)
webView.addObserver(self, forKeyPath: "title", options: .new, context: nil)
- webView.evaluateJavaScript("document.getElementsByTagName('body')[0].style.background='#FAFAFA'", completionHandler: nil)
+// webView.evaluateJavaScript("document.getElementsByTagName('body')[0].style.background='#FAFAFA'", completionHandler: nil)
/// 进度条
progressView.trackTintColor = .clear
extension FileDownloadVC: WKNavigationDelegate {
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
- webView.evaluateJavaScript(
- "document.getElementsByTagName('body')[0].style.background='#FAFAFA'",
- completionHandler: nil)
+// webView.evaluateJavaScript(
+// "document.getElementsByTagName('body')[0].style.background='#FAFAFA'",
+// completionHandler: nil)
}
func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) {
k_log("==== error: \(error)")
label.do { v in
v.font = .regular(14)
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
v.numberOfLines = 0
let text = "请您确保您是有权进行本撤回同意隐私政策操作的相关当事人。撤回同意隐私政策,您将放弃以下资产或者权益:\n\n1.数据清空\n将会停止收集您的个人信息。您使用DeepChords应用过程中产生的数据将被清空;手机中DeepChords应用的缓存数据将被清除。\n\n2.设备解除绑定\nDeepChords账号中,所有设备会与您当前登录的账号解除绑定,并清除设备之前存储在服务器的数据。存储在物理设备中的数据请通过人工本地物理重置来清除。如果您需要重新使用设备,需要您再次进行绑定并且重新授权。\n\n3.其他\n此举还将撤回您对用户协议的同意,并退出DeepChords应用。\n\n请您知悉,撤回同意隐私政策不代表撤回同意前的相关行为和责任得到豁免或减轻。若您需要重新在该账号管理设备,需要您重新授权并绑定。请谨慎操作!".l10n
}
deviceLabel.do { (v) in
v.backgroundColor = .color(.cellBg)
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(14)
v.textAlignment = .center
v.yc.setCornerRadius(15)
v.text = ""
}
nameLabel.do { (v) in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(14)
v.textAlignment = .left
v.text = "云储存空间".l10n
v.textAlignment = .left
}
valueLabel.do { v in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(14)
v.textAlignment = .right
}
view.backgroundColor = .color(.bgColor)
phoneView.do { v in
- v.textField.placeholder = "请输入昵称".l10n
+ v.textField.attributedPlaceholder = NSAttributedString(string: "请输入昵称".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
+
v.textField.keyboardType = .default
}
loginBtn.set(title: "确定".l10n,style: .theme1, target: self, action: #selector(loginAction))
desLabel.do { v in
v.text = "耳机在附近,可通过响铃进行查找".l10n
v.font = .regular(14)
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
}
leftBtn.do { v in
valueLabel.textColor = backgroundColor
}
else{
- backgroundColor = .white
+ backgroundColor = .color(.cellBg)
titleLabel.textColor = .color(.first)
valueLabel.backgroundColor = .color(.theme)
valueLabel.textColor = .white
imgBg.backgroundColor = .color(.theme)
}
else{
- titleLabel.textColor = .rgb(0x666666)
+ titleLabel.textColor = .color(.secondary)
imgBg.backgroundColor = .color(.bgColor)
}
}
v.contentMode = .center
}
titleLabel.do { (v) in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(12)
}
}
tagLabel.do { v in
v.text = "旋律"
v.font = .regular(12)
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
}
musicView.do { v in
v.yc.setCornerRadius(6)
// Created by liangshi on 2025/8/26.
//
-//class BrokenLineView: UIView {
-// override func draw(_ rect: CGRect) {
-// super.draw(rect)
-// let path = UIBezierPath()
-// let lineWidth: CGFloat = 0.5
-// let dashLength: CGFloat = 5.0
-// let spaceLength: CGFloat = 3.0
-// let startPoint = CGPoint(x: 0, y: bounds.midY)
-// let endPoint = CGPoint(x: bounds.width, y: bounds.midY)
-// path.move(to: startPoint)
-// path.addLine(to: endPoint)
-// let shapeLayer = CAShapeLayer()
-// shapeLayer.path = path.cgPath
-// shapeLayer.strokeColor = UIColor.hexString("#93C6EC").cgColor
-// shapeLayer.fillColor = UIColor.clear.cgColor
-// shapeLayer.lineWidth = lineWidth
-// shapeLayer.lineDashPattern = [NSNumber(value: dashLength), NSNumber(value: spaceLength)]
-// layer.addSublayer(shapeLayer)
-// }
-//}
class BrokenLineView: UIView {
private var shapeLayer: CAShapeLayer!
private func setupShapeLayer() {
shapeLayer = CAShapeLayer()
- shapeLayer.strokeColor = UIColor.hexString("#93C6EC").cgColor
+ shapeLayer.strokeColor = UIColor.color(.separateLine).cgColor
shapeLayer.fillColor = UIColor.clear.cgColor
shapeLayer.lineWidth = 0.5
shapeLayer.lineDashPattern = [NSNumber(value: 5.0), NSNumber(value: 3.0)]
v.textAlignment = .left
}
valueLabel.do { v in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(14)
v.textAlignment = .right
}
// }
func startAnimating(){
loading = true
- activeView.backgroundColor = .white
+ activeView.backgroundColor = .color(.cellBg)
activeView.startAnimating()
}
func stopAnimating(){
label.do { v in
v.backgroundColor = .clear
v.textAlignment = .center
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
v.font = .regular(16)
}
textView.do { v in
label.do { v in
v.backgroundColor = .clear
v.textAlignment = .left
- v.textColor = .hexString("#999999")
+ v.textColor = UIColor.color(.placeholder)
v.font = .regular(14)
v.numberOfLines = 0
// v.backgroundColor = .red
textField.do { v in
v.backgroundColor = .clear
- v.placeholder = "请输入...".l10n
+ v.attributedPlaceholder = NSAttributedString(string: "请输入...".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
v.returnKeyType = .done
v.delegate = self
}
v.textAlignment = .left
v.numberOfLines = 0
v.font = .regular(12)
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
}
selectButton.do { (v) in
v.yc.setBorder(width: 1.fitR, color: .rgb(0x999999), radius: 2.fitR)
override func setupStyle() {
super.setupStyle()
- contentView.backgroundColor = .white
+ contentView.backgroundColor = .color(.cellBg)
titleLabel.do { (v) in
- v.textColor = .rgb(0x333333)
+ v.textColor = .color(.secondary)
v.font = .semiBold(16)
v.textAlignment = .center
v.text = title
v.addTarget(self, action: #selector(closeAction), for: .touchUpInside)
}
tableView.do { v in
- v.backgroundColor = .white
+ v.backgroundColor = .color(.cellBg)
v.delegate = self
v.dataSource = self
v.rowHeight = 52
selectedIcon.image = UIImage(named: "cell_selected")
line.do { v in
- v.backgroundColor = .hexString("#F2F2F2")
+ v.backgroundColor = .hexString("#.color(.separateLine)")
}
}
// backgroundColor = .blue
titleLabel.do { (v) in
- v.textColor = .rgb(0x333333)
+ v.textColor = .color(.first)
v.font = .semiBold(16)
v.textAlignment = .center
v.text = "请选择语言".l10n
label.do { (v) in
v.font = .medium(14)
v.textAlignment = .center
- v.backgroundColor = .white
+ v.backgroundColor = .color(.bgColor)
v.textColor = .color(.theme)
v.yc.setBorder(width: 1.5, color: .color(.theme), radius: 9)
}
override func setupStyle() {
super.setupStyle()
- contentView.backgroundColor = .white
+ contentView.backgroundColor = .color(.cellBg)
segView.do { v in
v.valueChange = { [weak self] in
}
tableView.do { v in
// v.isScrollEnabled = false
- v.backgroundColor = .white
+ v.backgroundColor = .color(.cellBg)
v.delegate = self
v.dataSource = self
v.rowHeight = 52
selectedIcon.image = UIImage(named: "cell_selected")
line.do { v in
- v.backgroundColor = .hexString("#F2F2F2")
+ v.backgroundColor = .hexString("#.color(.separateLine)")
}
}
// v.backgroundColor = .red
}
bottonView.do { v in
- v.backgroundColor = .white
+ v.backgroundColor = .color(.cellBg)
v.yc.setBorder(width: 1.5, color: .color(.theme), radius: 9)
v.yc.addTap(target: self, action: #selector(switchAction))
}
v.textAlignment = .left
}
nameLabel.do { (v) in
- v.textColor = .rgb(0x666666)
+ v.textColor = .color(.secondary)
v.font = .regular(14)
v.textAlignment = .left
v.text = "云储存空间".l10n
}
progressView.do { v in
v.yc.setCornerRadius(2)
+ v.progressTintColor = .color(.theme)
}
yc.addTap(target: self, action: #selector(closeAction))
closeBtn.do { v in
override func setupLayout() {
super.setupLayout()
contentView.do { (v) in
- v.backgroundColor = .white
+ v.backgroundColor = .color(.cellBg)
v.yc.setCornerRadius(20)
}
}
progressLabel.do { v in
v.text = "00:00"
- v.textColor = .hexString("#666666")
+ v.textColor = .color(.secondary)
v.textAlignment = .center
v.font = .regular(12)
}
override func setupLayout() {
super.setupLayout()
contentView.do { (v) in
- v.backgroundColor = .white
+ v.backgroundColor = .color(.cellBg)
v.yc.setCornerRadius(20)
}
make.centerY.equalToSuperview().offset(-60)
}
titleLabel.do { (v) in
- v.textColor = .rgb(0x121212)
+ v.textColor = .color(.first)
v.font = .bold(20)
v.textAlignment = .center
v.text = "保存录音".l10n
}
textFiled.do { v in
v.text = Date().format(.full3)
- v.placeholder = "请输入录音名字".l10n
+ v.attributedPlaceholder = NSAttributedString(string: "请输入录音名字".l10n, attributes: [NSAttributedString.Key.foregroundColor: UIColor.color(.placeholder)])
v.font = .bold(16)
v.textColor = .color(.first)
// v.becomeFirstResponder()
"scale" : "1x"
},
{
- "filename" : "Frame (3).png",
+ "filename" : "Slice 100@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Frame (4).png",
+ "filename" : "Slice 100@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "record_normal@2x.png",
+ "filename" : "智能对话录音条-静态.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "record_normal@3x.png",
+ "filename" : "录音条-静态.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "Group_2122@2x.png",
+ "filename" : "Group 2158@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Group_2122@3x.png",
+ "filename" : "Group 2158@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "Frame_2245@2x.png",
+ "filename" : "Group_2299@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Frame_2245@3x.png",
+ "filename" : "Group_2299@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "Frame_2246@2x.png",
+ "filename" : "Group_2299@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Frame_2246@3x.png",
+ "filename" : "Group_2299@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "Frame 2254.png",
+ "filename" : "Slice 76@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Frame 2254 (1).png",
+ "filename" : "Slice 76@3x.png",
"idiom" : "universal",
"scale" : "3x"
}