- Full macOS support: a brand new
TextViewListener
class forNSTextView
instances
MaskedTextInputListener
now provides call forwarding to its correspondingtextFieldDelegate
andtextViewDelegate
🔄 Modified:
Country::findCountries
→ fix bloomer
🔄 Modified:
NumberInputListener
was made available to iOS 15.6
🔄 Modified:
MaskedTextInputListener.replaceCharacters()
: apply a patch to counter iOS Undo Manager, see #84
🔄 Modified:
UITextInput.caretPosition.setter
now updates caret position only if it changed
NumberInputListener
: aMaskedTextInputListener
allowing to enter currencies and other numbers"".numberOfOccurrencesOf(string)
: a helper method to count occurencies of substrings
🔄 Modified:
CharacterSet.isMember(character:)
madepublic
MaskedTextInputListener
:UITextFieldDelegate
andUITextViewDelegate
extensions madeopen
MaskedTextInputListener.atomicCaretMovement
is now applied everywhere
🔄 Modified:
spec.platform
→ios, 15.6
- New logo :D
- New README :D
- A basic UI test in the Sample project for the date/phone fields
"".extractDigits()
: a helper method to extract digits from aString
"".boxSizeWithFont(font)
: a helper method to calculate a rectangle size for aString
- Text listener callbacks now return a
tailPlaceholder
for the value to be completed Country
: a model object representing a country with phone formatting, ISO codes & emojisCountry.all
: a dictionary of known countriesMaskedTextField
: a SwiftUITextField
with an attached mask- A SwiftUI sample project
PhoneInputListener
: aMaskedTextInputListener
allowing to enter a phone number of any known country
UITextField.cursorPosition
: please use aUITextInput.caretPosition
property insteadUITextView.cursorPosition
: please use aUITextInput.caretPosition
property instead
🔄 Modified:
swift-tools-version
→5.7.1
- Pod platform →
16.1
- iOS text suggestions support (see
UITextContentType
)
Mask::apply()
, theautocomplete
flag (this flag is now a part of theCaretGravity.forward
enum case)
CaretGravity.forward
, theautocomplete
flagCaretGravity.backward
, theautoskip
flag
-
CaretStringIterator::beforeCaret()
(this method is now replaced with::insertionAffectsCaret()
and::deletionAffectsCaret()
calls) -
::deleteText()
and::modifyText()
inMaskedTextFieldDelegate
,MaskedTextInputListener
andMaskedTextViewDelegate
(these methods had been refactored and merged)
Please, consider overriding corresponding
textField(:shouldChangeCharactersIn:replacementString:)
textInput(:isChangingCharactersIn:replacementString:)
or
textView(:shouldChangeTextIn:replacementText:)
instead.
CaretString
instances now contain caret gravity.
Caret gravity affects caret movement when Mask
adds characters precisely at the caret position during formatting. It is important to retain caret position after text deletion/backspacing.
Default CaretGravity
is .forward
. Set caret gravity to .backward
only when user hits backspace.
CaretStringIterator::insertionAffectsCaret()
andCaretStringIterator::deletionAffectsCaret()
These methods allow to incorporate new caret gravity setting. RTLCaretStringIterator
had also been rewritten to reflect these changes.
🔄 Modified:
- Atomic cursor movement is now turned off by default.
AffinityCalculationStrategy.extractedValueCapacity
option allowing to have radically different mask format depending on the extracted value length
AffinityCalculationStrategy.capacity
option allowing to have radically different mask format depending on the input length
Mask.isValid(format:customNotations:)
method for format checksMaskedTextFieldDelegate.atomicCursorMovement
andMaskedTextInputListener.atomicCaretMovement
properties in order to address issue #32
↩️ Fixed:
- Optional blocks of symbols are now ignored when extracted value completeness is calculated
textFieldDidEndEditing
delegate method not called- by Mikhail Zhadko in PR#65