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

Свойство TextBox сделать публичным #5

Open
modestman opened this issue Nov 5, 2019 · 3 comments
Open

Свойство TextBox сделать публичным #5

modestman opened this issue Nov 5, 2019 · 3 comments

Comments

@modestman
Copy link

  • В TextField и TextView свойство textBox сделать публичным
  • В TextBox свойство state сделать публичным
  • Добавить делегат (или KVO) для возможности отслеживания изменения свойства TextBox.state

Примерно такой протокол:

public protocol TextBoxDelegate: class {
    func willChangeState(newValue: TextInputState, animated: Bool)
    func didChangeState(newValue: TextInputState, animated: Bool)
}
@Alexander-Ignition
Copy link
Collaborator

Делегат не нужен, можно обойтись методом для переопределения

@modestman
Copy link
Author

Покажи пример кода

@Alexander-Ignition
Copy link
Collaborator

open TextField {    
    private func updateState(animated: Bool) {
        // ...
        inputStateDidUpdate()
    }

    open func inputStateDidUpdate() {
        //
    }
}

@joliejuly joliejuly assigned joliejuly and unassigned joliejuly Nov 6, 2019
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

3 participants