AttributedLabel
@MainActor
open class AttributedLabel : UIView
-
事件代理
Declaration
Swift
@MainActor open weak var delegate: AttributedLabelDelegate?
-
字体
Declaration
Swift
@MainActor open var font: UIFont? { get set }
-
文字颜色
Declaration
Swift
@MainActor open var textColor: UIColor? { get set }
-
链接点击时背景高亮色
Declaration
Swift
@MainActor open var highlightColor: UIColor? { get set }
-
链接色
Declaration
Swift
@MainActor open var linkColor: UIColor? { get set }
-
阴影颜色
Declaration
Swift
@MainActor open var shadowColor: UIColor? { get set }
-
阴影offset
Declaration
Swift
@MainActor open var shadowOffset: CGSize { get set }
-
阴影半径
Declaration
Swift
@MainActor open var shadowBlur: CGFloat { get set }
-
链接是否带下划线
Declaration
Swift
@MainActor open var underLineForLink: Bool { get set }
-
自动检测
Declaration
Swift
@MainActor open var autoDetectLinks: Bool { get set }
-
自定义链接检测器,默认shared
Declaration
Swift
@MainActor open var linkDetector: AttributedLabelURLDetectorProtocol? { get set }
-
链接点击句柄
Declaration
Swift
@MainActor open var clickedOnLink: ((Any) -> Void)?
-
行数
Declaration
Swift
@MainActor open var numberOfLines: Int { get set }
-
文字排版样式
Declaration
Swift
@MainActor open var textAlignment: CTTextAlignment { get set }
-
LineBreakMode
Declaration
Swift
@MainActor open var lineBreakMode: CTLineBreakMode { get set }
-
行间距
Declaration
Swift
@MainActor open var lineSpacing: CGFloat { get set }
-
段间距
Declaration
Swift
@MainActor open var paragraphSpacing: CGFloat { get set }
-
普通文本,设置nil可重置
Declaration
Swift
@MainActor open var text: String? { get set }
-
属性文本,设置nil可重置
Declaration
Swift
@MainActor open var attributedText: NSAttributedString? { get set }
-
最后一行截断之后留白的宽度,默认0不生效,仅lineBreakMode为TruncatingTail且发生截断时生效
Declaration
Swift
@MainActor open var lineTruncatingSpacing: CGFloat { get set }
-
最后一行截断之后显示的附件
Declaration
Swift
@MainActor open var lineTruncatingAttachment: AttributedLabelAttachment? { get set }
-
Undocumented
Declaration
Swift
@MainActor override public init(frame: CGRect)
-
Undocumented
Declaration
Swift
@MainActor public required init?(coder: NSCoder)
-
Undocumented
Declaration
Swift
@MainActor override open var frame: CGRect { get set }
-
Undocumented
Declaration
Swift
@MainActor override open var bounds: CGRect { get set }
-
Undocumented
Declaration
Swift
@MainActor override open func sizeThatFits(_ size: CGSize) -> CGSize
-
Undocumented
Declaration
Swift
@MainActor override open var intrinsicContentSize: CGSize { get }
-
Undocumented
Declaration
Swift
@MainActor override open func draw(_ rect: CGRect)
-
Undocumented
Declaration
Swift
@MainActor override open func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?)
-
Undocumented
Declaration
Swift
@MainActor override open func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?)
-
Undocumented
Declaration
Swift
@MainActor override open func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?)
-
Undocumented
Declaration
Swift
@MainActor override open func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?)
-
Undocumented
Declaration
Swift
@MainActor override open func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView?
-
添加文本
Declaration
Swift
@MainActor open func appendText(_ text: String)
-
Undocumented
Declaration
Swift
@MainActor open func appendAttributedText(_ attributedText: NSAttributedString)
-
图片
Declaration
Swift
@MainActor open func appendImage(_ image: UIImage)
-
Undocumented
Declaration
Swift
@MainActor open func appendImage(_ image: UIImage, maxSize: CGSize, margin: UIEdgeInsets = .zero, alignment: AttributedLabelAlignment = .center)
-
UI控件
Declaration
Swift
@MainActor open func appendView(_ view: UIView, margin: UIEdgeInsets = .zero, alignment: AttributedLabelAlignment = .center)
-
添加自定义链接
Declaration
Swift
@MainActor open func addCustomLink(_ linkData: Any, for range: NSRange, attributes: [NSAttributedString.Key : Any]? = nil)