Skip to content

carabina/Hedwig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hedwig

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.

Instead of just showing notification, Hedwig tries to be interactive. When a notification pops up, it will be more efficient and user-friendly if the user is able to handle it directly, especially for sophisticated applications like Facebook. Hedwig currently has a tap gesture recognizer so that you can handle the notification by adding an action to it. You can also customize it by adding views and gesture recognizers to satisfy your needs. Although it seems quite simple at the time, the concept behind is more important, and there are a lot Hedwig can develop in the future for better interaction.

Installation

  • Create a Podfile, and add Hedwig:
target '<Your Project Name>' do
    pod 'Hedwig', '~> 1.0'
end
  • Run $ pod install in your project directory.
  • Open Project.xcworkspace and build.
github "Lab111/Hedwig" ~> 1.0
  • Run carthage update in your project directory.
  • Drag Hedwig.framework from Carthage/Build into your Xcode project.

Configuration

Hedwig works as a singleton, so you talk to shared directly to configure it. Some common configurations are listed below:

  • Height: Hedwig.shared.height
  • Background Color: Hedwig.shared.windowShade.backgroundColor
  • Text Color: Hedwig.shared.label.textColor
  • Font: Hedwig.shared.label.font
  • Slide Duration: Hedwig.shared.windowShade.slideDuration
  • Display Duration: Hedwig.shared.displayDuration

Usage

Show Notification

import Hedwig

Hedwig.show(notification: "Hello from Hedwig")

You can add action to the tapGestureRecognizer when asking Hedwig to show notification.

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

Hide Notification

Hedwig.hide()

Hedwig will hide automatically if the displayDuration is positive, but you can hide it manually before it hides automatically. Be aware that Hedwig will hide the notification when the user swipes up over it.

License

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

About

Interactive Notification

Resources

License

Stars

Watchers

Forks

Packages

No packages published