Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

🔔 Button Badge SwiftUI

A SwiftUI notification-badge button that counts taps with a springy, animated badge

Platform iOS Swift SwiftUI Xcode Stars Last Commit

📖 Overview

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.

✨ Features

  • 🔔 SF Symbol bell button that increments a notification count on each tap
  • 🔴 Circular count badge overlaid with a ZStack and 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 ButtonModifiers and NotificationTextModifiers view modifiers
  • 🗂️ Clean MVVM layout with an ObservableObject view model

📸 Preview

Screenshot 2025-12-05 at 01 21 44 Screenshot 2025-12-05 at 01 22 23 Screenshot 2025-12-05 at 01 22 31 Screenshot 2025-12-05 at 01 22 35 Screenshot 2025-12-05 at 01 22 39

🚀 Getting Started

git clone https://github.com/ahmetbostanciklioglu/ButtonBadgeSwiftUI.git
cd ButtonBadgeSwiftUI
open ButtonBadgeSwiftUI.xcodeproj

Once the project is open in Xcode, select an iOS Simulator (or a connected device) and press Cmd + R to build and run.

📋 Requirements

  • iOS 26.1+
  • Xcode 16 or later
  • Swift 5

🧑‍💻 Author

Ahmet Bostancıklıoğlu@ahmetbostanciklioglu · ahmetbostancikli@gmail.com

⭐ If this helped you, consider giving the repo a star!

About

SwiftUI notification-badge bell button that counts taps with an animated, spring-driven badge (MVVM).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages