No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-02-11 21:28:41 +00:00
iOS-tapCounter feat: converted from pwa-tapCounter #0dc9e97b54 2026-02-11 21:28:41 +00:00
iOS-tapCounter.xcodeproj feat: converted from pwa-tapCounter #0dc9e97b54 2026-02-11 21:28:41 +00:00
README.md feat: converted from pwa-tapCounter #0dc9e97b54 2026-02-11 21:28:41 +00:00

iOS Tap Counter

A native iOS port of the Tap Counter PWA. Built with Swift and SwiftUI, this app counts taps on the screen and provides visual feedback with a green flash animation.

Features

  • Full-screen tap target — tap anywhere to increment the counter
  • Green flash animation (0.3s) on each tap
  • Deep blue background (#003DA5) with white bold text
  • Portrait orientation lock
  • Dark mode forced for consistent status bar appearance

Requirements

  • Xcode 15.0+
  • iOS 16.0+
  • Swift 5.0

Getting Started

  1. Open iOS-tapCounter.xcodeproj in Xcode.
  2. Select your development team under Signing & Capabilities (target > General > Signing).
  3. Choose a simulator or connected device.
  4. Build and run (Cmd + R).

Project Structure

iOS-tapCounter/
├── iOS-tapCounter.xcodeproj/
│   └── project.pbxproj              # Xcode project configuration
└── iOS-tapCounter/
    ├── iOS_tapCounterApp.swift       # App entry point (@main)
    ├── ContentView.swift             # Main UI and tap logic
    └── Assets.xcassets/
        ├── Contents.json
        ├── AccentColor.colorset/     # Accent color (#003DA5)
        │   └── Contents.json
        └── AppIcon.appiconset/       # App icon (add a 1024x1024 PNG)
            └── Contents.json

Architecture

The app is two Swift files:

  • iOS_tapCounterApp.swift — The @main entry point. Creates a WindowGroup containing ContentView and forces dark color scheme.
  • ContentView.swift — All UI and logic. Uses a ZStack to layer the blue background, green flash overlay, and counter text. Tapping anywhere increments the count and triggers the flash animation via SwiftUI's withAnimation.

How the flash works

  1. On tap, isFlashing is set to true with a 0.3s ease-out animation, fading in the green overlay.
  2. After 0.15s, isFlashing is set back to false with a 0.15s ease-out animation, fading it out.
  3. The result is a quick green pulse that matches the PWA's behavior.

App Icon

The AppIcon.appiconset is configured for a single 1024x1024 image (iOS automatically generates all other sizes). To add an icon:

  1. Place a 1024x1024 PNG in Assets.xcassets/AppIcon.appiconset/.
  2. Update the Contents.json to reference the filename:
    {
      "images": [
        {
          "filename": "your-icon.png",
          "idiom": "universal",
          "platform": "ios",
          "size": "1024x1024"
        }
      ],
      "info": {
        "author": "xcode",
        "version": 1
      }
    }
    

Configuration

Key build settings are defined in project.pbxproj:

Setting Value
Bundle Display Name Tap Counter
Bundle Identifier com.tapcounter.iOS-tapCounter
Deployment Target iOS 16.0
Supported Orientations Portrait only
Status Bar Style Light content
Device Family iPhone and iPad

Differences from the PWA

PWA iOS
Framework Vanilla HTML/CSS/JS SwiftUI
Offline support Service worker cache Native (no network needed)
Installation Add to Home Screen App Store / Xcode
Font size 2.5rem (~40px) 40pt system bold
Animation CSS keyframe on <body> SwiftUI opacity transition

License

Same license as the parent project.