From 0dfd2016adffeb4d02dbe02f90985d33cb4165a5 Mon Sep 17 00:00:00 2001 From: Aleksandr Shushkov Date: Wed, 20 Apr 2022 14:29:13 +0300 Subject: [PATCH] feat: add nsattrbutedstring property to viewtext --- .../ViewText/ViewText+NSAttributedString.swift | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 TIUIKitCore/Sources/Extensions/ViewText/ViewText+NSAttributedString.swift diff --git a/TIUIKitCore/Sources/Extensions/ViewText/ViewText+NSAttributedString.swift b/TIUIKitCore/Sources/Extensions/ViewText/ViewText+NSAttributedString.swift new file mode 100644 index 00000000..1b2ebab7 --- /dev/null +++ b/TIUIKitCore/Sources/Extensions/ViewText/ViewText+NSAttributedString.swift @@ -0,0 +1,9 @@ +public extension ViewText { + var attributedString: NSAttributedString? { + guard let text = text else { + return nil + } + + return attributes.attributedString(for: text) + } +}