Skip to content

Commit

Permalink
Update DDLoggerSwiftTableViewCell.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
DamonHu committed Feb 25, 2025
1 parent 3d8ec6a commit 3b90377
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions pod/view/DDLoggerSwiftTableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@
import UIKit

class DDLoggerSwiftTableViewCell: UITableViewCell {
private lazy var mCollapseLabel: UILabel = {
var label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false
label.font = UIFont.systemFont(ofSize: 14, weight: .bold)
return label
}()

private lazy var mContentLabel: UILabel = {
var label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false
Expand Down Expand Up @@ -56,20 +49,14 @@ class DDLoggerSwiftTableViewCell: UITableViewCell {
private func _createUI() -> Void {
self.backgroundColor = UIColor.clear

self.contentView.addSubview(mCollapseLabel)
self.mCollapseLabel.leftAnchor.constraint(equalTo: self.contentView.leftAnchor, constant: 10).isActive = true
self.mCollapseLabel.centerYAnchor.constraint(equalTo: self.contentView.centerYAnchor).isActive = true
self.mCollapseLabel.widthAnchor.constraint(equalToConstant: 20).isActive = true
self.mCollapseLabel.heightAnchor.constraint(equalToConstant: 20).isActive = true

self.contentView.addSubview(self.mContentLabel)
self.mContentLabel.leftAnchor.constraint(equalTo: self.mCollapseLabel.rightAnchor, constant: 10).isActive = true
self.mContentLabel.rightAnchor.constraint(equalTo: self.contentView.rightAnchor, constant: -10).isActive = true
self.mContentLabel.leftAnchor.constraint(equalTo: self.contentView.leftAnchor, constant: 16).isActive = true
self.mContentLabel.rightAnchor.constraint(equalTo: self.contentView.rightAnchor, constant: -16).isActive = true
self.mContentLabel.topAnchor.constraint(equalTo: self.contentView.topAnchor, constant: 15).isActive = true
self.mContentLabel.bottomAnchor.constraint(equalTo: self.contentView.bottomAnchor, constant: -10).isActive = true

self.contentView.addSubview(self.mIDLabel)
self.mIDLabel.rightAnchor.constraint(equalTo: self.contentView.rightAnchor, constant: -10).isActive = true
self.mIDLabel.rightAnchor.constraint(equalTo: self.contentView.rightAnchor, constant: -16).isActive = true
self.mIDLabel.topAnchor.constraint(equalTo: self.contentView.topAnchor, constant: 3).isActive = true
}

Expand All @@ -79,10 +66,7 @@ class DDLoggerSwiftTableViewCell: UITableViewCell {
self.mContentLabel.textColor = loggerItem.mLogItemType.textColor()
var contentString = loggerItem.getFullContentString()
if model.isCollapse {
mCollapseLabel.text = "🗂"
contentString = contentString.dd.subString(rang: NSRange(location: 0, length: DDLoggerSwift.cellDisplayCount))
} else {
mCollapseLabel.text = loggerItem.icon()
}
loggerItem.getHighlightAttributedString(contentString: contentString, highlightString: highlightText) { (hasHighlightStr, hightlightAttributedString) in
if model.isCollapse {
Expand Down

0 comments on commit 3b90377

Please sign in to comment.