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

Expose inputView and reloadInputViews method #15

Closed
wants to merge 2 commits into from

Conversation

MainasuK
Copy link
Contributor

Problems

Due to the internal UITextView marked private. We can not access the inputView on it.

Solution

Make an interface to expose the API. So that the client could use the inputView to customize input.

Testing
Delear an empty UIInputView and call the reloadInputViews(). It works.

        let textEditorView = TextEditorView()
        let inputView = UIInputView(frame: CGRect(x: 0, y: 0, width: 0, height: 300), inputViewStyle: .keyboard)
        inputView.allowsSelfSizing = true
        textEditorView.inputView = inputView
        textEditorView.reloadInputViews()

@CLAassistant
Copy link

CLAassistant commented Mar 25, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@niw niw left a comment

Choose a reason for hiding this comment

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

I think this change makes sense, one small request for documentation.

}
}

public override func reloadInputViews() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add /// :nodoc: for this line as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Updated

Copy link
Contributor

@niw niw left a comment

Choose a reason for hiding this comment

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

Looks good to me, we will merge the change to the internal repository once it passed also internal review as well.

When we publish the change here, I will close this pull request.
Thank you for the contribution.

Copy link

@sheboo7191ii sheboo7191ii left a comment

Choose a reason for hiding this comment

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

niw pushed a commit that referenced this pull request Apr 10, 2021
**Problems**

Due to the internal `UITextView` marked private. We can not access the
`inputView` on it.

**Solution**

Make an interface to expose the API. So that the client could use the
`inputView` to customize input.

GitHub Pull Request: #15
#15

JIRA Issues: IOS-96982

Differential Revision: https://phabricator.twitter.biz/D642129
niw added a commit that referenced this pull request Apr 10, 2021
**Problems**

`TextEditorView` provides some convinient `UIResponder` properties and method
implementation, however it prevents changes default behavior and makes users
difficult to use these.

**Solution**

- Provides `inputViewController` read-write property in addition to `inputView`
  which is implemented by #15.
- Make `inputViewController`, `inputAccessoryView`, and
  `inputAccessoryViewController` goes up the responder chain as like `UITextView`,
  but not `inputView` (due to `UITextView` implementation.)
- Reorganize `UIResponder` related implementation in the code.

JIRA Issues: IOS-96169

Differential Revision: https://phabricator.twitter.biz/D649268
@niw
Copy link
Contributor

niw commented Apr 10, 2021

The change has been merged to the tip branch and pushed, closing the pull request.
Thank you for the contribution.

@niw niw closed this Apr 10, 2021
@MainasuK
Copy link
Contributor Author

Thanks, @niw. I notice the PR is merged into the master.

And is there any plan to make a release to make that feature debut? The Swift SPM needs a version tag to make the dependency update.

@niw
Copy link
Contributor

niw commented Apr 16, 2021

@MainasuK We will release with a version tag when we confirmed it’s stable soon!

@niw
Copy link
Contributor

niw commented Apr 23, 2021

I tagged 1.1.0 and it's available now.

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.

None yet

4 participants