Latest 0.4.0
Homepage https://github.com/wxxsw/GSMessages
License MIT
Platforms ios 8.0, requires ARC
Authors

GSMessages

GSCountdownButton
GSCountdownButton
GSCountdownButton
GSCountdownButton
GSCountdownButton
GSCountdownButton

Demo

GSCountdownButton

Example

To show notifications use the following code:

self.showMessage("Something success", type: .success)

To display a notice on a view:

view.showMessage("Something success", type: .success)

To hide a notification manually:

self.hideMessage()

Options (Current setting is default value):

  • type : success / error / warning / info
  • animation : slide / fade
  • position : top / bottom
  • textAlignment : left / center / right
self.showMessage("Some Text...", type: .success, options: [
    .animation(.slide),
    .animationDuration(0.3),
    .autoHide(true),
    .autoHideDelay(3.0),
    .height(44.0),
    .hideOnTap(true),
    .position(.top),
    .textAlignment(.center),
    .textColor(UIColor.white),
    .textNumberOfLines(1),
    .textPadding(30.0)
])

Font / Background Color

To set custom fonts and background colors in the following ways:

GSMessage.font = UIFont.boldSystemFont(ofSize: 14)
GSMessage.successBackgroundColor = UIColor(red: 142.0/255, green: 183.0/255, blue: 64.0/255,  alpha: 0.95)
GSMessage.warningBackgroundColor = UIColor(red: 230.0/255, green: 189.0/255, blue: 1.0/255,   alpha: 0.95)
GSMessage.errorBackgroundColor   = UIColor(red: 219.0/255, green: 36.0/255,  blue: 27.0/255,  alpha: 0.70)
GSMessage.infoBackgroundColor    = UIColor(red: 44.0/255,  green: 187.0/255, blue: 255.0/255, alpha: 0.90)

Requirements

Master

  • iOS 8.0+
  • Xcode 9.0+ (Swift 4.x)

1.3.5

  • iOS 8.0+
  • Xcode 8.0+ (Swift 3.x)

1.2.4

  • iOS 7.0+
  • Xcode 7.3+ (Swift 2.x)

Installation

CocoaPods:

In your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod "GSMessages"

And in your *.swift:

import GSMessages

Carthage:

In your Cartfile:

github "wxxsw/GSMessages"

And in your *.swift:

import GSMessages

License

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

Latest podspec

{
    "name": "GSCountdownButton",
    "version": "0.4.0",
    "summary": "Easy to use countdown button.",
    "homepage": "https://github.com/wxxsw/GSMessages",
    "license": "MIT",
    "authors": {
        "GeSen": "[email protected]"
    },
    "source": {
        "git": "https://github.com/wxxsw/GSCountdownButton.git",
        "tag": "0.4.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "GSCountdownButton",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This