Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

InputMask 7.3.2 iOS #734

Open
Open
@ramsyFathima94

Description

@ramsyFathima94

How to set date format to MM/DD/YYYY using InputMask 7.3.2

I'm using the InputMask 7.3.2 library in my iOS project. I want to set the input mask for a date field to display in the formatMM/DD/YYYY and also set the placeholder toMM/DD/YYYY.

Here is my code:

import InputMaskclassViewController:UIViewController{@IBOutlet weakvardateTextField:UITextField!overridefunc viewDidLoad(){        super.viewDidLoad()                // Set up the mask for the date fieldletdateMask="[00]{/}[00]{/}[0000]"letlistener=MaskedTextInputListener(primaryFormat: dateMask)        dateTextField.delegate= listener                // Set placeholder text        dateTextField.placeholder="MM/DD/YYYY"}}

The input mask works correctly, but the placeholder does not display as expected. It showsMM/DD/YYYY only when there is no input.

Is there a way to keep the placeholderMM/DD/YYYY visible until the user starts typing? Also, how can I ensure the input mask applies correctly as the user types?

Thank you in advance for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp