@@ -33,7 +33,7 @@ public class NextGrowingTextView: UIScrollView {
3333
3434 public class Delegates {
3535 public var shouldChangeTextInRange : ( range: NSRange , replacementText: String ) -> Bool = { _ in true }
36- public var shouldInteractWithURL : ( URL: NSURL , inRange: NSRange ) -> Bool = { _ in true }
36+ public var shouldInteractWithURL : ( URL: URL , inRange: NSRange ) -> Bool = { _ in true }
3737 public var shouldInteractWithTextAttachment : ( textAttachment: NSTextAttachment , inRange: NSRange ) -> Bool = { _ in true }
3838 public var textViewDidBeginEditing : ( NextGrowingTextView ) -> Void = { _ in }
3939 public var textViewDidChangeSelection : ( NextGrowingTextView ) -> Void = { _ in }
@@ -150,9 +150,9 @@ public class NextGrowingTextView: UIScrollView {
150150 private func setup( ) {
151151
152152 self . textView. delegate = self
153- self . textView. scrollEnabled = false
154- self . textView. font = UIFont . systemFontOfSize ( 16 )
155- self . textView. backgroundColor = UIColor . clearColor ( )
153+ self . textView. isScrollEnabled = false
154+ self . textView. font = UIFont . systemFont ( ofSize : 16 )
155+ self . textView. backgroundColor = UIColor . clear ( )
156156 self . addSubview ( textView)
157157 self . minHeight = simulateHeight ( 1 )
158158 self . maxNumberOfLines = 3
@@ -162,7 +162,7 @@ public class NextGrowingTextView: UIScrollView {
162162 return textView. sizeThatFits ( CGSize ( width: self . bounds. width, height: CGFloat . infinity) )
163163 }
164164
165- private func measureFrame( contentSize: CGSize ) -> CGRect {
165+ private func measureFrame( _ contentSize: CGSize ) -> CGRect {
166166
167167 let selfSize : CGSize
168168
@@ -221,13 +221,13 @@ public class NextGrowingTextView: UIScrollView {
221221 self . fitToScrollView ( )
222222 }
223223
224- private func simulateHeight( line: Int ) -> CGFloat {
224+ private func simulateHeight( _ line: Int ) -> CGFloat {
225225
226226 let saveText = self . textView. text
227227 var newText = " - "
228228
229229 self . textView. delegate = nil
230- self . textView. hidden = true
230+ self . textView. isHidden = true
231231
232232 for _ in 0 ..< line- 1 {
233233 newText += " \n |W| "
@@ -238,7 +238,7 @@ public class NextGrowingTextView: UIScrollView {
238238 let height = self . measureTextViewSize ( ) . height
239239
240240 self . textView. text = saveText
241- self . textView. hidden = false
241+ self . textView. isHidden = false
242242 self . textView. delegate = self
243243
244244 return height
@@ -254,7 +254,7 @@ extension NextGrowingTextView {
254254
255255 // MARK: TextView Extension
256256
257- public var placeholderAttributedText : NSAttributedString ? {
257+ public var placeholderAttributedText : AttributedString ? {
258258 get { return self . textView. placeholderAttributedText }
259259 set { self . textView. placeholderAttributedText = newValue }
260260 }
@@ -303,16 +303,16 @@ extension NextGrowingTextView {
303303 }
304304
305305 public var selectable : Bool {
306- get { return self . textView. selectable }
307- set { self . textView. selectable = newValue }
306+ get { return self . textView. isSelectable }
307+ set { self . textView. isSelectable = newValue }
308308 }
309309
310310 public var allowsEditingTextAttributes : Bool {
311311 get { return self . allowsEditingTextAttributes }
312312 set { self . allowsEditingTextAttributes = newValue }
313313 }
314314
315- public var attributedText : NSAttributedString ! {
315+ public var attributedText : AttributedString ! {
316316 get { return self . textView. attributedText }
317317 set {
318318 self . textView. attributedText = newValue
@@ -325,7 +325,7 @@ extension NextGrowingTextView {
325325 set { self . textView. typingAttributes = newValue }
326326 }
327327
328- public func scrollRangeToVisible( range: NSRange ) {
328+ public func scrollRangeToVisible( _ range: NSRange ) {
329329 self . textView. scrollRangeToVisible ( range)
330330 }
331331
@@ -393,39 +393,39 @@ extension NextGrowingTextView {
393393
394394extension NextGrowingTextView : UITextViewDelegate {
395395
396- public func textView( textView: UITextView , shouldChangeTextInRange range: NSRange , replacementText text: String ) -> Bool {
396+ public func textView( _ textView: UITextView , shouldChangeTextIn range: NSRange , replacementText text: String ) -> Bool {
397397 return self . delegates. shouldChangeTextInRange ( range: range, replacementText: text)
398398 }
399399
400- public func textView( textView: UITextView , shouldInteractWithURL URL: NSURL , inRange characterRange: NSRange ) -> Bool {
400+ public func textView( _ textView: UITextView , shouldInteractWith URL: URL , in characterRange: NSRange ) -> Bool {
401401 return self . delegates. shouldInteractWithURL ( URL: URL, inRange: characterRange)
402402 }
403403
404- public func textView( textView: UITextView , shouldInteractWithTextAttachment textAttachment: NSTextAttachment , inRange characterRange: NSRange ) -> Bool {
404+ public func textView( _ textView: UITextView , shouldInteractWith textAttachment: NSTextAttachment , in characterRange: NSRange ) -> Bool {
405405 return self . delegates. shouldInteractWithTextAttachment ( textAttachment: textAttachment, inRange: characterRange)
406406 }
407407
408- public func textViewDidBeginEditing( textView: UITextView ) {
408+ public func textViewDidBeginEditing( _ textView: UITextView ) {
409409 self . delegates. textViewDidBeginEditing ( self )
410410 }
411411
412- public func textViewDidChangeSelection( textView: UITextView ) {
412+ public func textViewDidChangeSelection( _ textView: UITextView ) {
413413 self . delegates. textViewDidChangeSelection ( self )
414414 }
415415
416- public func textViewDidEndEditing( textView: UITextView ) {
416+ public func textViewDidEndEditing( _ textView: UITextView ) {
417417 self . delegates. textViewDidEndEditing ( self )
418418 }
419419
420- public func textViewShouldBeginEditing( textView: UITextView ) -> Bool {
420+ public func textViewShouldBeginEditing( _ textView: UITextView ) -> Bool {
421421 return self . delegates. textViewShouldBeginEditing ( self )
422422 }
423423
424- public func textViewShouldEndEditing( textView: UITextView ) -> Bool {
424+ public func textViewShouldEndEditing( _ textView: UITextView ) -> Bool {
425425 return self . delegates. textViewShouldEndEditing ( self )
426426 }
427427
428- public func textViewDidChange( textView: UITextView ) {
428+ public func textViewDidChange( _ textView: UITextView ) {
429429
430430 self . delegates. textViewDidChange ( self )
431431
0 commit comments