{"id":2476,"url":"https://github.com/Minitour/EasyNotificationBadge","last_synced_at":"2025-08-03T00:31:48.103Z","repository":{"id":54879471,"uuid":"65452109","full_name":"Minitour/EasyNotificationBadge","owner":"Minitour","description":"UIView extension that adds a notification badge.","archived":false,"fork":false,"pushed_at":"2021-01-22T17:02:46.000Z","size":918,"stargazers_count":214,"open_issues_count":1,"forks_count":34,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-11-14T14:12:48.428Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Minitour.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-11T08:23:21.000Z","updated_at":"2024-07-11T15:56:24.000Z","dependencies_parsed_at":"2022-08-14T05:31:07.097Z","dependency_job_id":null,"html_url":"https://github.com/Minitour/EasyNotificationBadge","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Minitour%2FEasyNotificationBadge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Minitour%2FEasyNotificationBadge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Minitour%2FEasyNotificationBadge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Minitour%2FEasyNotificationBadge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Minitour","download_url":"https://codeload.github.com/Minitour/EasyNotificationBadge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228510702,"owners_count":17931751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:16:14.692Z","updated_at":"2024-12-06T18:30:29.572Z","avatar_url":"https://github.com/Minitour.png","language":"Swift","readme":"\n\u003cimg src=\"Screenshots/heading.gif\"  height=\"100\" /\u003e\n\n[![CocoaPods](https://img.shields.io/cocoapods/v/EasyNotificationBadge.svg)]()\n[![CocoaPods](https://img.shields.io/cocoapods/l/EasyNotificationBadge.svg)]()\n[![CocoaPods](https://img.shields.io/cocoapods/p/EasyNotificationBadge.svg)]()\n\n## Installation\n\n### CocoaPods\n\n```bash\npod 'EasyNotificationBadge'\n```\n\n### Swift Package Manager\n\nYou can use [The Swift Package Manager](https://swift.org/package-manager) to install `EasyNotificationBadge` by adding the proper description to your `Package.swift` file:\n\n```swift\n// swift-tools-version:4.0\nimport PackageDescription\n\nlet package = Package(\n    name: \"YOUR_PROJECT_NAME\",\n    dependencies: [\n        .package(url: \"https://github.com/Minitour/EasyNotificationBadge.git\", from: \"1.2.4\"),\n    ]\n)\n```\nThen run `swift build` whenever you're ready.\n\nOr simply drag and drop ```NSBadge.swift``` to your project.\n\n## Usage\n\nTo add a badge with default settings use this (This also applies to updating an existing badge):\n```swift\nview.badge(text: \"5\")\n```\n\nTo remove the badge:\n\n```swift\nview.badge(text: nil)\n```\n\n## Advanced Usage\n\n```swift\nvar badgeAppearance = BadgeAppearance()\nbadgeAppearance.backgroundColor = UIColor.blue //default is red\nbadgeAppearance.textColor = UIColor.white // default is white\nbadgeAppearance.textAlignment = .center //default is center\nbadgeAppearance.textSize = 15 //default is 12\nbadgeAppearance.distanceFromCenterX = 15 //default is nil\nbadgeAppearance.distanceFromCenterY = -10 //default is nil\nbadgeAppearance.allowShadow = true\nbadgeAppearance.borderColor = .blue\nbadgeAppearance.borderWidth = 1\nview.badge(text: \"Your text\", appearance: badgeAppearance)\n```\n\n### Important\nWhen calling `.badge` make sure that the view has already been loaded and has a superview. Setting a badge on a view that hasn't fully loaded can lead to unexpected results.\n","funding_links":[],"categories":["UI","Swift"],"sub_categories":["Badge","Other free courses"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMinitour%2FEasyNotificationBadge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMinitour%2FEasyNotificationBadge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMinitour%2FEasyNotificationBadge/lists"}