AbstractHintService

public protocol AbstractHintService

Abstract protocl for hint service.

You can use existed HintService from this library, this service will do all work for supporting hint messages, or you can provide your own service which have to implement this protocol.

  • This method provides your service with a label, where you have to place hint message

    Declaration

    Swift

    func provide(label: UILabel)
  • Method where you have to setup initial state for hint label

    Declaration

    Swift

    func configureAppearance()
  • Method invokes when field wants to update UI elements. You have to update visibility of you hint, it’s color, etc.

    Declaration

    Swift

    func updateContent(containerState: FieldContainerState,
                       heightLayoutPolicy: HeightLayoutPolicy,
                       animated: Bool)
  • Method allows to calculate current hint message height, or returns zero if hint message doesn’t exist or invisible

    Declaration

    Swift

    func hintHeight(containerState: FieldContainerState) -> CGFloat
  • Method allows setup hint message

    Declaration

    Swift

    func setup(plainHint: String?)
  • Method allows setup error hint message.

    If errorHint is nil - you have to save previous plain hint message in label, if it exists.

    Declaration

    Swift

    func setup(errorHint: String?)
  • Method to drop all error hint messages and present plain hint, if it exists.

    Declaration

    Swift

    func showHint()
  • Service method, which allows you to change current visible hint states.

    Declaration

    Swift

    func setup(visibleHintStates: HintVisibleStates)