Latest 1.0.0
Homepage https://github.com/TimOliver/TOBadgeView
License MIT
Platforms ios 9.0, requires ARC

TOBadgeView

CocoaPods
Version
GitHub license
Platform
PayPal

TOBadgeView is a very basic UIView subclass to provide a GPU-efficient recreation of the class iOS badge icon.

It is wholly dynamic, where all sizing, fonts and colors can be changed, and it can intelligently resize itself to fit a particular text value.

Features

  • Recreates the standard iOS badge icon and style.
  • Uses Core Animation and Metal to provide VERY efficient layer compositing.

System Requirements

iOS 9.0 and above.

Installation

As a CocoaPods Dependency

Add the following to your Podfile:

pod 'TOBadgeView'

Manual Installation

Copy the folder TOBadgeView to your Xcode project.

TOBadgeView is an Objective-C project, but it has been written to work properly in Swift as well. If you are using it in a Swift project, don’t forget to include it in your Objective-C bridging header.

Examples

TOBadgeView is very bare-bones and behaves in what should be a very intuitive manner.

Hello World Example

let badgeView = BadgeView() // Create the badge view
badgeView.text = "1"
badgeView.sizeToFit() // Change the badge view size to fit

Credits

TOBadgeView was originally created by Tim Oliver as a component for iComics, a comic reader app for iOS.

iOS Device mockups used in the screenshot created by Pixeden.

License

TOBadgeView is licensed under the MIT License, please see the LICENSE file. analytics

Latest podspec

{
    "name": "TOBadgeView",
    "version": "1.0.0",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "summary": "A view subclass that recreates the standard iOS badge icon",
    "homepage": "https://github.com/TimOliver/TOBadgeView",
    "authors": "Tim Oliver",
    "source": {
        "git": "https://github.com/TimOliver/TOBadgeView.git",
        "tag": "1.0.0"
    },
    "requires_arc": true,
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "TOBadgeView/**/*.{h,m}"
}

Pin It on Pinterest

Share This