Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Conversation

@Tantalum73
Copy link
Contributor

This PR is a response to #105. It implements a maximum height for a multiline TextView.

The new limit can be configured by setting an associated value to the AnimatedTextInputType-Enum case .multiline like this: .multiline(maxHeight: 150).

If the multiline label should not be limited in height, the user specifies .multiline(maxHeight: nil).

It can be configured by using .multiline(<#maxHeight#>).
Copy link
Contributor

@victorBaro victorBaro left a comment

Choose a reason for hiding this comment

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

I love your PR. The only thing I am a bit concern about is making the api more "ugly".
I don't like this:
sut.type = .multiline(maxHeight: nil)
It would be great if we could have default values to associated values.
Or we could have a new case, something like:

case multiline
case multilineRestricted(maxHeight: CGFloat)

That would allow us to get rid of the optional. What do you think?

@Tantalum73
Copy link
Contributor Author

Thank you for your suggestion!
I totally see your point. I would call it .heightConstraintMultiline but then autocorrect may miss it when the developer types .multi. Therefore I'll go with .multilineRestricted 👍🏼

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants