Latest 1.3
Homepage https://github.com/lab111/hedwig
License MIT
Platforms ios 10.0
Authors

Hello from Hedwig

Hedwig shows notification and enables users to handle it.

Hedwig (d. 27 July, 1997) was Harry Potter’s pet Snowy Owl. For more information, see Hedwig | Harry Potter Wiki.

Installation

CocoaPods

CocoaPods manages library dependencies for your Xcode projects. For usage, see CocoaPods Guides – Using CocoaPods.

target '<Your Project Name>' do
    pod 'Hedwig', '~> 1.3'
end

Carthage

Carthage is intended to be the simplest way to add frameworks to your Cocoa application. For usage, see Carthage – Adding frameworks to an application.

github "lab111/hedwig" ~> 1.3

Configuration

The properties available for configuration and the default values are listed below:

  • Hedwig.height = 64
  • Hedwig.backgroundColor = UIColor.black
  • Hedwig.textColor = UIColor.white
  • Hedwig.font = UIFont.systemFont(ofSize: 17)
  • Hedwig.slideDuration = TimeInterval(UINavigationControllerHideShowBarDuration)
  • Hedwig.displayDuration = nil

Configuration while a notification is on display is invalid.

Usage

import Hedwig

Show Notification

Hedwig.show(notification: "Hello from Hedwig")
Hedwig.show(notification: "Hello from Hedwig", handler: nil) { (complete) in
    print(complete)
}

Hedwig enables users to handle notification by tapping it, and the handler is declared at this point.

Hedwig.show(notification: "Hello from Hedwig", handler: { (_) in
    print("Tap")
}, completion: nil)

Hide Notification

If the value of Hedwig.displayDuration is positive, Hedwig will hide notification automatically after that duration. And the user can dismiss the notification by swiping up over it. But you can always hide it by calling the following methods:

Hedwig.hide()
Hedwig.hide() { (complete) in
    print(complete)
}

License

Hedwig is released under the MIT license. For details, see LICENSE.

Latest podspec

{
    "name": "Hedwig",
    "version": "1.3",
    "summary": "Interactive Notification",
    "homepage": "https://github.com/lab111/hedwig",
    "license": "MIT",
    "authors": {
        "Lab 7": "[email protected]"
    },
    "platforms": {
        "ios": "10.0"
    },
    "source": {
        "git": "https://github.com/Lab111/Hedwig.git",
        "tag": "1.3"
    },
    "source_files": [
        "Sources",
        "Sources/*.swift"
    ],
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "3"
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This