A SwiftUI notification-badge button that counts taps with a springy, animated badge
Button Badge SwiftUI is a compact demo that recreates the familiar notification-bell button seen in most apps. Each tap on the bell increments a counter, and a circular badge overlays the button to show the current count, animating in and out with a spring effect. The badge stays hidden while the count is zero. The project follows a small MVVM structure and shows how to keep styling reusable through custom SwiftUI ViewModifiers.
- 🔔 SF Symbol bell button that increments a notification count on each tap
- 🔴 Circular count badge overlaid with a
ZStackand offset into the top-right corner - 🎈 Spring animation driven by changes to the notification count
- 🙈 Badge automatically hidden when the count is zero
- 🧩 Reusable styling via custom
ButtonModifiersandNotificationTextModifiersview modifiers - 🗂️ Clean MVVM layout with an
ObservableObjectview model
git clone https://github.com/ahmetbostanciklioglu/ButtonBadgeSwiftUI.git
cd ButtonBadgeSwiftUI
open ButtonBadgeSwiftUI.xcodeprojOnce the project is open in Xcode, select an iOS Simulator (or a connected device) and press Cmd + R to build and run.
- iOS 26.1+
- Xcode 16 or later
- Swift 5
Ahmet Bostancıklıoğlu — @ahmetbostanciklioglu · ahmetbostancikli@gmail.com
⭐ If this helped you, consider giving the repo a star!




