Latest 0.1
Homepage https://github.com/mrcly/SweetMessages
License MIT
Platforms ios 9.0, requires ARC
Frameworks Foundation, UIKit
Authors

SweetMessages

Sweet Messages is a library that provides an easy way to show messages/notifications to the user.

Getting started

For better examples see the example project.

Installation

CocoaPods: pod 'SweetMessages'

Creating an instance

var message: SweetMessage?

override func viewDidLoad() {
    super.viewDidLoad()

    if let navigationController = self.navigationController {

      // init the info message
      self.message = SweetMessage(
        navigationController: navigationController,
        message: "It works!",
        style: SweetMessageStyleInfo
      )

      // set the delegate
      self.message?.delegate = self

    }
}

Show/Hide

self.message?.show()
// or
self.message?.hide()

Delegate

Your view controller must inherit the SweetMessageDelegate protocol.

func sweetMessageDidHide(sweetMessage: SweetMessage) {
    // the message did hide
}

func sweetMessageDidShow(sweetMessage: SweetMessage) {
    // the message did show
}

func sweetMessageWillHide(sweetMessage: SweetMessage) {
    // the message will hide
}

func sweetMessageWillShow(sweetMessage: SweetMessage) {
    // the message will show
}

To Do

  • Better animations
  • Better styling options
  • Better auto layout
  • Remove all bugs
  • Code documentation
  • Functionality for view controller without a navigation controller

If you have any ideas, just leave me a note or do a pull request.

License

MIT

Latest podspec

{
    "name": "SweetMessages",
    "version": "0.1",
    "summary": "Sweet Messages is a library that provides an easy way to show messages/notifications to the user.",
    "description": "Sweet Messages is a library that provides an easy way to show messages/notifications to the user.nn  * Custom stylesn  * Simple to use",
    "homepage": "https://github.com/mrcly/SweetMessages",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Marcel Stolin": "[email protected]"
    },
    "social_media_url": "https://twitter.com/mmrcly",
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/mrcly/SweetMessages.git",
        "tag": "0.1"
    },
    "source_files": "SweetMessages/**/*.swift",
    "frameworks": [
        "Foundation",
        "UIKit"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This