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

Swift Compiler Error: Type 'UITextView' has no member 'textDidChangeNotification' #72

Open
jvriccione opened this issue Sep 25, 2018 · 4 comments

Comments

@jvriccione
Copy link

Using v1.4.0 from cocoapods (latest as of the writing of this post).

In the file "NextGrowingInternalTextView.swift", the "addObserver" line from the code snippet below has an error with the name input parameter, saying "Type 'UITextView' has no member 'textDidChangeNotification'."

I have spent hours trying to determine why textDidChangeNotification is not being recognized. I have removed the dependency, added it back, cleaned, and rebuilt multiple times to no avail. Perhaps it is deprecated in Swift 4. Would appreciate some help on this. Thanks!

override init(frame: CGRect, textContainer: NSTextContainer?) {
    super.init(frame: frame, textContainer: textContainer)

    NotificationCenter.default.addObserver(self, selector: #selector(NextGrowingInternalTextView.textDidChangeNotification(_ :)), name: UITextView.textDidChangeNotification, object: self)
  }

@jtaka1012
Copy link

jtaka1012 commented Sep 27, 2018

I also had same problem. (using Swift4.0)
I changed UITextView.textDidChangeNotification into .UITextViewTextDidChange and fixed this issue.

jtaka1012@232b127

I think that this fix works correctly.

But, I don't know that if this fix will work under Swift 4.2.

@techtic-bhavin
Copy link

i also had same issue facing with swift 4.2.0

@asifSdSol
Copy link

NSNotification.Name.UITextViewTextDidChange Swift 4.2

@kayes55
Copy link

kayes55 commented Apr 21, 2019

thank you @jtaka1012

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

5 participants