@@ -54,7 +54,7 @@ public struct TouchResult {
54
54
public let linkResult : LinkResult ?
55
55
public let touches : Set < UITouch >
56
56
public let event : UIEvent ?
57
- public let state : UIGestureRecognizerState
57
+ public let state : UIGestureRecognizer . State
58
58
}
59
59
60
60
public struct TextLink {
@@ -135,18 +135,18 @@ open class ContextLabel: UILabel, NSLayoutManagerDelegate, UIGestureRecognizerDe
135
135
}
136
136
137
137
public var underlineStyle : ( LinkResult ) -> NSUnderlineStyle = { _ in
138
- return . styleNone
138
+ return [ ]
139
139
}
140
140
141
141
public var modifiedAttributedString : ( ( NSAttributedString ) -> NSAttributedString ) ?
142
142
143
143
public var didTouch : ( TouchResult ) -> Void = { _ in }
144
144
145
- public var didCopy : ( String ! ) -> Void = { _ in }
145
+ public var didCopy : ( String ? ) -> Void = { _ in }
146
146
147
147
// MARK: - Properties
148
148
149
- public var touchState : UIGestureRecognizerState = . possible
149
+ public var touchState : UIGestureRecognizer . State = . possible
150
150
151
151
// LineSpacing
152
152
public var lineSpacing : CGFloat ?
@@ -463,7 +463,7 @@ open class ContextLabel: UILabel, NSLayoutManagerDelegate, UIGestureRecognizerDe
463
463
464
464
// MARK: - Methods
465
465
466
- func addAttributes( _ attributes: Dictionary < NSAttributedStringKey , Any > , range: NSRange ) {
466
+ func addAttributes( _ attributes: Dictionary < NSAttributedString . Key , Any > , range: NSRange ) {
467
467
if let contextLabelData = contextLabelData {
468
468
let mutableAttributedString = NSMutableAttributedString ( attributedString: contextLabelData. attributedString)
469
469
mutableAttributedString. addAttributes ( attributes, range: range)
@@ -510,7 +510,7 @@ open class ContextLabel: UILabel, NSLayoutManagerDelegate, UIGestureRecognizerDe
510
510
self . textLinks = textLinks
511
511
}
512
512
513
- open func attributesFromProperties( ) -> [ NSAttributedStringKey : Any ] {
513
+ open func attributesFromProperties( ) -> [ NSAttributedString . Key : Any ] {
514
514
515
515
// Shadow attributes
516
516
let shadow = NSShadow ( )
@@ -547,7 +547,7 @@ open class ContextLabel: UILabel, NSLayoutManagerDelegate, UIGestureRecognizerDe
547
547
}
548
548
549
549
// Attributes dictionary
550
- var attributes : [ NSAttributedStringKey : Any ] = [
550
+ var attributes : [ NSAttributedString . Key : Any ] = [
551
551
. shadow: shadow,
552
552
. paragraphStyle: mutableParagraphStyle,
553
553
. foregroundColor: color
@@ -560,14 +560,14 @@ open class ContextLabel: UILabel, NSLayoutManagerDelegate, UIGestureRecognizerDe
560
560
return attributes
561
561
}
562
562
563
- fileprivate func attributesWithTextColor( _ textColor: UIColor ) -> [ NSAttributedStringKey : Any ] {
563
+ fileprivate func attributesWithTextColor( _ textColor: UIColor ) -> [ NSAttributedString . Key : Any ] {
564
564
var attributes = attributesFromProperties ( )
565
565
attributes [ . foregroundColor] = textColor
566
566
567
567
return attributes
568
568
}
569
569
570
- fileprivate func attributes( with font: UIFont ? , textColor: UIColor , underlineStyle: NSUnderlineStyle ) -> [ NSAttributedStringKey : Any ] {
570
+ fileprivate func attributes( with font: UIFont ? , textColor: UIColor , underlineStyle: NSUnderlineStyle ) -> [ NSAttributedString . Key : Any ] {
571
571
var attributes = attributesWithTextColor ( textColor)
572
572
attributes [ . underlineStyle] = underlineStyle. rawValue
573
573
if let font = font {
0 commit comments