0

I’m trying to define a placeholder for UITextView, but unfortunately unlike UITextField it doesn’t have that attribute. In order to speed up my development process I’ve made some search and found a library (https://github.com/MoZhouqi/KMPlaceholderTextView) that solves that problem.

My problem starts with the implementation of methods/funcionalities of another library (https://github.com/SwiftValidatorCommunity/SwiftValidator) which is used for fields validation. Since I’m using a UITextView subclass the validator doesn’t recognize it as a validatable field and requires it to be cast as a validatable field. But once I cast it, the app crashes when trying to validate the KM TextView.

My question is, is there any way to make the 2 libraries interact and make them compatible with each other? If so, how can I make this?

  • Putting aside the dangers of subclassing UITextView (which does not explicitly support being subclassed), it's unclear what you're doing in code. Why doesn't the validator recognize your text view as validatable? What error does it return? What do you mean when you say "cast as a validatable field." In what way does it crash and where? – Rob Napier Feb 15 '18 at 00:55

1 Answers1

0

Both libraries are under the MIT License. They are just source code that compiles and runs. You can pull them down into your projects and edit the code to get it to do whatever you like. Its just code. Don't be afraid of it (although I can understand why it would seem like a daunting task).

The problem that would then happen would be you maintaining those new libraries over time. If you carefully make and minimize your changes, you should be able to rebase them with any changes made to the master repositories. You can set up your own git repository and keep your changes on there.

HalR
  • 11,411
  • 5
  • 48
  • 80