Latest 0.7.0
Homepage https://github.com/Q42/NoticeWindow
License MIT
Platforms ios 9.0, requires ARC
Authors

NoticeWindow CI Status
Version
License
Platform


Present your custom notices in the application window so the notice isn’t lost after leaving the screen.

Example

First, set the NoticeWindow to be the window of the AppDelegate:

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

  var window: UIWindow? = NoticeWindow(frame: UIScreen.main.bounds)

  // Helper property to quickly access the NoticeWindow
  static var noticeWindow: NoticeWindow? {
    return (UIApplication.shared.delegate as? AppDelegate)?.window as? NoticeWindow
  }

}

Second, present a Notice using the static var on AppDelegate:

AppDelegate.noticeWindow?.presentNotice(title: "Oops", message: "An error has occurred", style: .error)

The default error style can be customized by changing properties on the NoticeViewStyle struct. For example:

var style = NoticeViewStyle.error
style.backgroundColor = UIColor(red: 0.839, green: 0.345, blue: 0.227, alpha: 1.00)
style.rightImage = .close

AppDelegate.noticeWindow?.presentNotice(title: "Oops", message: "An error has occurred", style: style)

For more detailed examples, including how to use a custom view, see the Example project in this repository.

Installation

NoticeWindow is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "NoticeWindow"

Releases

  • 0.7.0 – 2018-10-02 – Swift 4.2 support
  • 0.6.1 – 2018-01-28 – Improved iPhone X support
  • 0.6.0 – 2017-09-17 – Experimental iPhone X support
  • 0.5.2 – 2017-02-09 – Fix AutoLayout warnings
  • 0.5.1 – 2017-01-19 – CocoaPods release
  • 0.5.0 – 2017-01-02 – Swift 3 support
  • 0.4.0 – 2016-11-06 – Support more styling
  • 0.1.1 – 2015-12-08 – Initial public release
  • 0.0.0 – 2015-04-28 – Initial private version for project at Q42

License

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

Latest podspec

{
    "name": "NoticeWindow",
    "version": "0.7.0",
    "summary": "Present your custom notices in the application window.",
    "description": "Present your custom notices in the application window so the notice isn't lost after leaving the screen.",
    "homepage": "https://github.com/Q42/NoticeWindow",
    "license": "MIT",
    "authors": {
        "Tim van Steenis": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Q42/NoticeWindow.git",
        "tag": "0.7.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "swift_version": "4.2",
    "requires_arc": true,
    "source_files": "Pod/Classes/*",
    "resource_bundles": {
        "NoticeWindow": [
            "Pod/Resources/*.xib",
            "Pod/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This