File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11Pod ::Spec . new do |s |
22 s . name = 'AttributedTextView'
3- s . version = '1.0 .0'
3+ s . version = '1.1 .0'
44 s . license = { :type => "MIT" , :file => "LICENSE" }
55 s . summary = 'Easiest way to create an attributed UILabel or UITextView (with support for multiple links and HTML)'
66 s . homepage = 'https://github.com/evermeer/AttributedTextView'
Original file line number Diff line number Diff line change @@ -77,9 +77,12 @@ import UIKit
7777 _attributer = newValue
7878 self . attributedText = _attributer? . attributedText
7979
80- self . isUserInteractionEnabled = true
81- self . isSelectable = true
82- self . isEditable = false
80+ if _attributer? . hasCallbacks ( ) ?? false {
81+ // Without these makeInteract does not work
82+ self . isUserInteractionEnabled = true
83+ self . isSelectable = true
84+ self . isEditable = false
85+ }
8386 if let color = _attributer? . linkColor {
8487 self . linkTextAttributes = [ NSAttributedStringKey . foregroundColor. rawValue: color]
8588 }
Original file line number Diff line number Diff line change @@ -28,6 +28,13 @@ open class Attributer {
2828 */
2929 fileprivate var urlCallbacks : [ String : ( ( _ link: String ) -> ( ) ) ] = [ : ]
3030
31+ /**
32+ Do we have interactions
33+ */
34+ public func hasCallbacks( ) -> Bool {
35+ return urlCallbacks. count > 0
36+ }
37+
3138 /**
3239 The current active ranges that will be influenced by all functions.
3340 */
You can’t perform that action at this time.
0 commit comments