/SFSwiftNotification

Simple custom user notifications in Swift

Primary LanguageSwiftMIT LicenseMIT

SFSwiftNotification

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

Demo DEFAULT