Passcode Lock

Passcode Lock

A lock screen with an app glyph, six filling dots and a numeric keypad with pressed-state circles, Face ID and delete keys. A wrong code shakes the dots red with an error haptic, and the right one pulls the dots into a checkmark and slides the screen up to reveal your content.

Luiz Mello
  • auth
  • screen
  • interaction

snippet.swift391 lines

8 files • Scroll to see all →
//// A lock screen in the spirit of the system one, for apps that guard// private data (banking, journals, notes).//// - Six dots fill with a springy pop as digits come in.// - Keypad keys light up on press, with the classic letter captions.// - A wrong code shakes the dots red, plays an error haptic and clears.// - The right code pulls the dots together into a checkmark, the lock//   glyph opens, and the whole screen slides up to reveal your content.// - Face ID is simulated (no LocalAuthentication), so it works in previews.//// State lives in an `@Observable` model so a host (or demo) can type,// lock again, or swap the expected code.
Viewing: PasscodeLock.swift•1 of 8