Skip to content

Latest commit

 

History

History
57 lines (42 loc) · 1.76 KB

AnyFormatKit 1.0.0 MigrationGuide.md

File metadata and controls

57 lines (42 loc) · 1.76 KB

AnyFormatKit 1.0.0 Migration Guide

Breaking Changes

TextFormatterProtocol

  • TextFormatterProtocol was renamed to TextFormatter
  • formattedText(from:) method renamed to format()
  • unformattedText(from:) method renamed to unformat()
public protocol TextFormatter {
  func format(_ unformattedText: String?) -> String?
  func unformat(_ formattedText: String?) -> String?
}

TextInputFormatterProtocol

  • TextInputFormatterProtocol was renamed to TextInputFormatter
  • now have only one method formatInput(currentText:), how to use it look at demo project
protocol TextInputFormatter: TextFormatter {
  func formatInput(currentText: String, range: NSRange, replacementString text: String) -> FormattedTextValue
}

TextFormatter

TextFormatter was renamed to DefaultTextFormatter

TextInputFormatter

  • TextInputFormatter was renamed to DefaultTextInputFormatter
  • var allowedSymbolsRegex: String was removed. Filter moved to separate pod (look at Filter)
  • shouldChangeTextIn(textInput:) was removed (need to use formatInput(currentText:))

SumTextInputFormatter

  • var formattedPrefix: String? was removed
  • var allowedSymbolsRegex: String? was removed. Filter moved to separate pod (look at Filter)
  • func didBeginEditing() was removed
  • func shouldChangeTextIn(textInput:) was removed

Removed classes

  • MulticastDelegate
  • TextInput
  • TextInputDelegate
  • AttributedTextInputField
  • AttributedTextInputView
  • TextInputField
  • TextInputFieldDelegate
  • TextInputView
  • TextInputViewDelegate
  • TextInputController