Skip to content

Ahmerbaig02/SwiftMessageBar

 
 

Repository files navigation

Carthage compatible Version License Platform

SwiftMessageBar

An iOS message bar, written in Swift

image

Requirements

  • iOS 8+
  • Swift 3
  • For Swift 2.2 use a build tagged with 2.x.x
  • For Swift 1.2 use a build tagged with 1.x.x
  • Xcode 8.0+

Installation

You can use Carthage:

github "JanGorman/SwiftMessageBar"

or CocoaPods:

pod 'SwiftMessageBar'

Usage

The included sample code shows how to use the message bar. There are three different message types:

enum MessageType {
    case Error, Success, Info
}

To display a message:

import SwiftMessageBar

@IBAction func showSuccess(sender: AnyObject) {
	SwiftMessageBar.showMessageWithTitle("Success", message: "The Message Body", type: .Success)
}

You can customize the duration of each message and also pass in a tap handler closure that is executed when a user taps on the message.

To customize the look of the messages, create a custom MessageBarConfig and set it on the shared messagebar. You can adjust the background and font colors, and pass in custom images to display.

Licence

Agrume is released under the MIT license. See LICENSE for details

About

An iOS message bar, written in Swift

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 93.2%
  • Ruby 4.6%
  • Objective-C 2.2%