CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

SFSwiftNotification 0.0.3

SFSwiftNotification 0.0.3

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Dec 2014
SPMSupports SPM

Maintained by Simone Ferrini.



Simple custom user notifications

Install

  • Manually: Copy the file SFSwiftNotification.swift to your project.

  • CocoaPods: (Soon available)

Usage

In your ViewController

    var notifyView:SFSwiftNotification?

In viewDidLoad()

    notifyView = SFSwiftNotification(frame: notifyFrame,
                                         title: nil,
                                 animationType: AnimationType.AnimationTypeCollision,
                                     direction: Direction.LeftToRight,
                                      delegate: self)
    notifyView!.backgroundColor = UIColor.orangeColor()
    notifyView!.label.textColor = UIColor.whiteColor()
    notifyView!.label.text = "This is an SFSwiftNotification"
    self.view.addSubview(notifyView)

To start the notification:

    @IBAction func notify(sender : AnyObject) {

        self.notifyView!.animate(notifyFrame, delay: 1)
    }

Settings

AnimationTypes:

    .AnimationTypeCollision
    .AnimationTypeBounce

Directions:

    .TopToBottom
    .LeftToRight
    .RightToLeft

Screen

Demo DEFAULT

Demo DEFAULT