Skip to content

Commit 284714e

Browse files
committed
Fix for iOS 9
1 parent c7d0327 commit 284714e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

AttributedTextView.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'AttributedTextView'
3-
s.version = '0.9.0'
3+
s.version = '0.9.1'
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'

Demo/Base.lproj/Main.storyboard

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</userDefinedRuntimeAttributes>
4848
</textView>
4949
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="There should be a checklist here" lineBreakMode="wordWrap" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FMu-K3-dvr" customClass="AttributedLabelSubclassDemo" customModule="Demo" customModuleProvider="target">
50-
<rect key="frame" x="16" y="396" width="343" height="20.5"/>
50+
<rect key="frame" x="16" y="396" width="343" height="248.5"/>
5151
<fontDescription key="fontDescription" type="system" pointSize="17"/>
5252
<nil key="textColor"/>
5353
<nil key="highlightedColor"/>

Sources/AttributedTextView.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ import UIKit
1818
// required when using @IBDesignable
1919
override public init(frame: CGRect, textContainer: NSTextContainer?) {
2020
super.init(frame: frame, textContainer: textContainer)
21+
super.delegate = self
2122
}
2223

2324
// required when using @IBDesignable
2425
required public init?(coder aDecoder: NSCoder) {
2526
super.init(coder: aDecoder)
27+
super.delegate = self
2628
}
2729

2830
// Make sure configureAttributedTextView is called right after activation from the storyboard.
@@ -75,7 +77,6 @@ import UIKit
7577
_attributer = newValue
7678
self.attributedText = _attributer?.attributedText
7779

78-
super.delegate = self
7980
self.isUserInteractionEnabled = true
8081
self.isSelectable = true
8182
self.isEditable = false
@@ -217,7 +218,7 @@ import UIKit
217218
-property shouldInteractWith: the NSTextAttachement
218219
-property characterRange: the NSRange for the selection
219220
*/
220-
@available(iOS, introduced: 7.0, deprecated: 10.0, message: "Use textView:shouldInteractWithURL:inRange:forInteractionType: instead")
221+
@available(iOS, introduced: 7.0, deprecated: 10.0, message: "Use textView:shouldInteractWithTextAttachment:inRange:forInteractionType: instead")
221222
public func textView(_ textView: UITextView, shouldInteractWith textAttachment: NSTextAttachment, in characterRange: NSRange) -> Bool {
222223
return _delegate?.textView?(textView, shouldInteractWith: textAttachment, in: characterRange) ?? false
223224
}

0 commit comments

Comments
 (0)