No description
- Swift 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| iOS-tapCounter | ||
| iOS-tapCounter.xcodeproj | ||
| README.md | ||
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
- Open
iOS-tapCounter.xcodeprojin Xcode. - Select your development team under Signing & Capabilities (target > General > Signing).
- Choose a simulator or connected device.
- 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
@mainentry point. Creates aWindowGroupcontainingContentViewand forces dark color scheme. - ContentView.swift — All UI and logic. Uses a
ZStackto layer the blue background, green flash overlay, and counter text. Tapping anywhere increments the count and triggers the flash animation via SwiftUI'swithAnimation.
How the flash works
- On tap,
isFlashingis set totruewith a 0.3s ease-out animation, fading in the green overlay. - After 0.15s,
isFlashingis set back tofalsewith a 0.15s ease-out animation, fading it out. - 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:
- Place a 1024x1024 PNG in
Assets.xcassets/AppIcon.appiconset/. - Update the
Contents.jsonto 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.