Latest 0.1.1
Homepage https://github.com/pacu/NotificationBubbles
License MIT
Platforms ios 11.0
Authors

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

NotificationBubble is a class that displays a notification based on Options defining it’s style into a UIView.

Example: display a text input from a textfield, using a bubble that can handle a block when taapped.

  NotificationBubble.display(in: self.view, options: options, attributedText: NSAttributedString(string: self.textField.text ?? ""), handleTap: {
        self.present(UIAlertController.init(title: "", message: "bubble tapped", preferredStyle: UIAlertController.Style.alert), animated: true, completion: nil)

        })

a green bubble that shows with a 20p margin

public extension NotificationBubble {
    public static func sucessOptions(animation: NotificationBubble.Animation) -> [NotificationBubble.Style] {
        return [ NotificationBubble.Style.animation(animation),
                 NotificationBubble.Style.margins(UIEdgeInsets(top: 20, left: 0, bottom: 0, right: 0)),
                 NotificationBubble.Style.cornerRadius(8),
                 NotificationBubble.Style.duration(timeInterval: 5),
                 NotificationBubble.Style.backgroundColor(UIColor.green)]
    }

A red bubble

    public static func errorOptions(animation: NotificationBubble.Animation) -> [NotificationBubble.Style] {
        return [ NotificationBubble.Style.animation(animation),
                 NotificationBubble.Style.margins(UIEdgeInsets(top: 20, left: 0, bottom: 0, right: 0)),
                 NotificationBubble.Style.cornerRadius(8),
                 NotificationBubble.Style.duration(timeInterval: 5),
                 NotificationBubble.Style.backgroundColor(UIColor.red)]
    }

a gray bubble

    public static func neutralOptions(animation: NotificationBubble.Animation) -> [NotificationBubble.Style] {
        return [ NotificationBubble.Style.animation(animation),
                 NotificationBubble.Style.margins(UIEdgeInsets(top: 20, left: 0, bottom: 0, right: 0)),
                 NotificationBubble.Style.cornerRadius(8),
                 NotificationBubble.Style.duration(timeInterval: 5),
                 NotificationBubble.Style.backgroundColor(UIColor.lightGray)]
    }
}

Installation

NotificationBubbles is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'NotificationBubbles'

Usage

See example project

Author

Francisco Gindre, [email protected]

License

NotificationBubbles is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "NotificationBubbles",
    "version": "0.1.1",
    "summary": "Straight out-of-the-box notification bubbles",
    "description": "Just a rounded bubble to show text for an instant",
    "homepage": "https://github.com/pacu/NotificationBubbles",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Francisco Gindre": "[email protected]"
    },
    "source": {
        "git": "https://github.com/pacu/NotificationBubbles.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "ios": "11.0"
    },
    "source_files": "NotificationBubbles/**/*"
}

Pin It on Pinterest

Share This