Skip to content

arthurs97/MicrowaveTextField

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

MicrowaveTextField

An auto-formatting text field for time entry (iOS)

MicrowaveTextField is a UITextField subclass that supports auto-formatting, right to left time entry (as a microwave does). It shows minutes and seconds (m:ss) by default.

MTF can be customized to your use case by setting the following properties in its parent view controller's viewDidLoad():
MTF.shouldShowHundredths: Bool - If set to true, the MTF displays and formats with two decimal places (m:ss.hh). False by default.
MTF.shouldShowHours: Bool - If set to true, the MTF displays and formats with hours (h:mm:ss). False by default. Both shouldShowHundredths and shouldShowHours can be true (h:mm:ss.hh).
MTF.color: UIColor - Sets the color of the separating bar on the keyboard's 'done' button toolbar. UIColor.blue by default.

The user's entered value in seconds (as a Double) can be accessed through the MTF.value property.
If the user's time is needed as a formatted string, simply use the MTF.text property inherited from UITextField.

About

An auto-formatting text field for time entry (iOS)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages