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

Add missing delegate function (iOS) #7

Merged
merged 2 commits into from Jan 3, 2022
Merged

Conversation

darrarski
Copy link
Contributor

Summary

This PR adds missing UITextViewDelegate's function, which fixes #6.

What was done

  • Implement textViewDidChange(_ textView: UITextView) function in UXCodeTextViewRepresentable.Coordinator class.

Implement `textViewDidChange(_ textView: UITextView)` function
in `UXCodeTextViewRepresentable.Coordinator` class.
@@ -94,6 +94,12 @@ struct UXCodeTextViewRepresentable : UXViewRepresentable {
parent.source.wrappedValue = textView.string
}

#if os(iOS)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should probably be an #if os(macOS) #else then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

textViewDidChange(_ textView: UITextView) is only available on iOS. Not sure about macOS equivalent, but this should work. Personally, I would leave the textDidChange(_ notification: Notification) unconstrained, to make sure it works on other/older OS.

@helje5 helje5 merged commit 15045a9 into ZeeZide:main Jan 3, 2022
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

Successfully merging this pull request may close these issues.

Binding does not work on iOS 15.2
2 participants