refactored action
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
66f7b7d87f
commit
2bbe71e106
@ -14,6 +14,12 @@ public protocol ActionLabelAttributeModel: LabelAttributeModel {
|
|||||||
var action: PassthroughSubject<Void, Never> { get set }
|
var action: PassthroughSubject<Void, Never> { get set }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension ActionLabelAttributeModel {
|
||||||
|
public func addHandler(on attributedString: NSMutableAttributedString){
|
||||||
|
attributedString.addAttribute(NSAttributedString.Key.action, value: "handler", range: range)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public struct ActionLabelAttribute: ActionLabelAttributeModel {
|
public struct ActionLabelAttribute: ActionLabelAttributeModel {
|
||||||
|
|
||||||
public static func == (lhs: ActionLabelAttribute, rhs: ActionLabelAttribute) -> Bool {
|
public static func == (lhs: ActionLabelAttribute, rhs: ActionLabelAttribute) -> Bool {
|
||||||
@ -54,7 +60,7 @@ public struct ActionLabelAttribute: ActionLabelAttributeModel {
|
|||||||
if(shouldUnderline){
|
if(shouldUnderline){
|
||||||
UnderlineLabelAttribute(location: location, length: length).setAttribute(on: attributedString)
|
UnderlineLabelAttribute(location: location, length: length).setAttribute(on: attributedString)
|
||||||
}
|
}
|
||||||
attributedString.addAttribute(NSAttributedString.Key.action, value: "handler", range: range)
|
addHandler(on: attributedString)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user