CARVIEW |
Select Language
HTTP/2 200
date: Wed, 23 Jul 2025 06:22:07 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"443c1d7862031864a8b06d5a64ce958b"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=dVU6vBMeY6xv8eWijmIoy642SYr6jM%2FDJ8boLJFnKWDXM4S3wIVftsHA4%2Fujg2B4E%2FXN8U9wQDQrtaISHqCh0Jgc12FGcCsLBR7t%2B4V2kN98Zw3EWSOE%2BrmueNdsGHKChbH6DYzkkVSoGktpQqxs4%2F7uD46GBPmUvt3Yg2j4IkchoikXpmtU3tRT8uvP77nW%2FnqQnWiCZwp6tYU8eVk7P29hhrgp17%2BbfHH0pUrVvVdd9mW8I8ukguCXn172H8jdT%2FLKEZp%2BNJrMJZ5igRtJ9g%3D%3D--Pa8Z1ucsLP9ZJSZQ--Cs7Cwzmq3icpInCNBtZyWg%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1952948681.1753251726; Path=/; Domain=github.com; Expires=Thu, 23 Jul 2026 06:22:06 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Thu, 23 Jul 2026 06:22:06 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: ACA0:12BD61:4FD1FF:676F52:68807F8E
Home ยท RedMadRobot/input-mask-ios Wiki ยท GitHub
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 95
Home
Egor Taflanidi edited this page Jul 28, 2023
·
14 revisions
- For a quick start, scroll down
- Syntax: learn how to compose your masks
- Text field listeners: learn more about available text field listener (delegate) classes
- Phones and country codes: more info about the international phone number formats support
- Tail placeholder: implement a placeholder that is always visible & guides user input
- Multiple masks & affinity: you can have several formats associated with a single text field; this is a deeper look into how the library can decide between them
Advanced reading:
- Custom notations: discover how to extend the mask syntax
- Text field listener internals: read in detail about the logic behind listening to text changes
- Mask, State Machine & Compiler: find out about the main library engine
Swift Package Manager is the preferred way.
- Open project root settings โ Package Dependencies
- Click โAdd Package Dependency
- Click ๐Search or Enter Package URL
- Insert
https://github.com/RedMadRobot/input-mask-ios
- Click Add Package
- Wait for the package resolution, choose target, boom, done
Import the library:
import InputMask
Configure the text field:
let inputListener = MaskedTextInputListener(primaryFormat: "+380 ([00]) [000]-[00]-[00]")
textField.delegate = inputListener // remember that delegates are weak references
Done. Build, Run & Enjoy.
In order to attach our library to your UITextField
you may simply wire up a listener directly within the layout.
- Open the scene that contains the
UITextField
in question - Open Library
โโงL
โ findNSObject
โ drop it onto the Scene (the left hierarchy view) - In the Identity Inspector select a custom class for this object:
MaskedTextInputListener
- In the Attributes Inspector fill in the
Primary Mask Format
:+380 ([00]) [000]-[00]-[00]
, hit enterโ
- Context-click the
UITextField
, find thedelegate
outlet, drag it to theMaskedTextInputListener
object - Done. Build, Run & Enjoy.
Import the library:
import InputMask
Add into the view builder:
MaskedTextField(
text: $text, // text field contents
value: $value, // extracted value
complete: $complete, // value completeness, true/false
placeholder: placeholder, // UITextField::placeholder
primaryMaskFormat: "+380 ([00]) [000]-[00]-[00]"
)
Done. Build, Run & Enjoy.
You canโt perform that action at this time.