Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use textViewDidChange with "Revise APIs version" ? #50

Closed
fatihyildizhan opened this issue May 2, 2017 · 6 comments
Closed

How to use textViewDidChange with "Revise APIs version" ? #50

fatihyildizhan opened this issue May 2, 2017 · 6 comments

Comments

@fatihyildizhan
Copy link

fatihyildizhan commented May 2, 2017

How can I upgrade this to newer one?

let growingTextView: NextGrowingTextView

growingTextView.delegates.textViewDidChange = { (growingTextView: NextGrowingTextView) in
  // Do something
}
@sahuamit13
Copy link

I need textViewDidChange delegate method, how to use in updated version?

let growingTextView: NextGrowingTextView

growingTextView.delegates.textViewDidChange = { (growingTextView: NextGrowingTextView) in
// Do something
}

@muukii
Copy link
Collaborator

muukii commented May 2, 2017

@fatihyildizhan @sahuamit13

delegates.textViewDidChange was deprecated.
You can now use UITextViewDelegate from NextGrowingTextView.textView.delegate

@sahuamit13
Copy link

Hi muukii,

Thanks for your reply

UITextViewDelegate from NextGrowingTextView.textView.delegate

can you explain through it with example

Thanks

@muukii
Copy link
Collaborator

muukii commented May 4, 2017

@sahuamit13

okay,
It may works.

class ViewController: UIViewController {
  
  let nextTextView: NextGrowingTextView = ...

  override func viewDidLoad() {
    super.viewDidLoad()
    
    nextTextView.textView.delegate = self    
  }
}

extension ViewController: UITextViewDelegate {
  func textViewDidChange(_ textView: UITextView) {
    // here 🤠
  }
}

@sahuamit13
Copy link

Hi muukii,

Thanks it's working now..

@muukii
Copy link
Collaborator

muukii commented May 6, 2017

Hi

Nice🎉

@muukii muukii closed this as completed May 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants