Latest 0.2.0
Homepage https://github.com/pikachu987/NotificationView
License MIT
Platforms ios 8.0
Authors

Version
License
Platform
Swift 4.2

Introduce

You can easily implement iOS Basic Notification screens.
There is a default theme and a dark theme.
You can attach an image to the Notification screen with only the UIImageView.
You can adjust the disappearance time.
You can get a delegate or callback for the visible and disappearing states.
You can get delegates and callbacks for tap.

Theme Multiple
NotificationView NotificationView
Custom Duration
NotificationView NotificationView
Rotate
NotificationView

Screen

iPhoneSE iPhone8Plus
Vertical demo demo
Horizontal demo demo
iPhoneX iPad
Vertical demo demo
Horizontal demo demo

Theme

default dark
demo demo

Type

custom1 custom2
demo demo

Requirements

NotificationView written in Swift 4.2. Compatible with iOS 8.0+

Installation

Versioning notes

Version 0.1.1 introduces Swift 4 support, 0.2.0 Swift 4.2.

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

pod 'NotificationView'

Usage

import NotificationView

DefaultNotification

let notificationView = NotificationView.default
notificationView.title = title
notificationView.subtitle = subtitle
notificationView.body = body
notificationView.image = image
notificationView.show()

MultipleNotification

let notificationView = NotificationView()
notificationView.title = title
notificationView.subtitle = subtitle
notificationView.body = body
notificationView.image = image
notificationView.show()

done!

Property

NotificationView


//Theme for NotificationView. There are dark mode and default mode.
notificationView.theme

//The time at the top right of NotificationView.
notificationView.date

//The title of the NotificationView.
notificationView.title

//The subtitle of the NotificationView.
notificationView.subtitle

//The body of the NotificationView.
notificationView.body

//The image of the NotificationView.
notificationView.image

//The background color of the NotificationView.
notificationView.backgroundColor

//It is a dictionary that can contain any data.
notificationView.param

//The identifier for the NotificationView.
notificationView.identifier

//The time until the NotificationView is shown and then disappears.
notificationView.hideDuration

//An UIImageView that displays the AppIcon image.
notificationView.iconImageView

//An UILabel that displays the AppName text.
notificationView.appNameLabel

//An UILabel that displays the Date text.
notificationView.dateLabel

//An UILabel that displays the Title text.
notificationView.titleLabel

//An UILabel that displays the Subtitle text.
notificationView.subtitleLabel

//An UILabel that displays the Body text.
notificationView.bodyLabel

//An UIImageView that displays the Image.
notificationView.imageView

Method

NotificationView Show

notificationView.show()

notificationView.show { (state) in
    print("callback: (state)")
}

notificationView.showAfter(0.1)

notificationView.showAfter(0.1) { (state) in
    print("callback: (state)")
}

NotificationView Hide

notificationView.hide()

notificationView.hideAfter(0.1)

Delegate

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let notificationView = NotificationView()
        notificationView.delegate = self
    }
}

extension ViewController: NotificationViewDelegate {

    /**
    Called when NotificationView is willAppear.
    - Parameters:
    - notificationView: NotificationView
    */
    func notificationViewWillAppear(_ notificationView: NotificationView) {
        print("delegate: notificationViewWillAppear")
    }

    /**
    Called when NotificationView is didAppear.
    - Parameters:
    - notificationView: NotificationView
    */
    func notificationViewDidAppear(_ notificationView: NotificationView) {
        print("delegate: notificationViewDidAppear")
    }

    /**
    Called when NotificationView is willDisappear.
    - Parameters:
    - notificationView: NotificationView
    */
    func notificationViewWillDisappear(_ notificationView: NotificationView) {
        print("delegate: notificationViewWillDisappear")
    }

    /**
    Called when NotificationView is didDisappear.
    - Parameters:
    - notificationView: NotificationView
    */
    func notificationViewDidDisappear(_ notificationView: NotificationView) {   
        print("delegate: notificationViewDidDisappear")
    }

    /**
    Called when the NotificationView is touched.
    - Parameters:
    - notificationView: NotificationView
    */
    func notificationViewDidTap(_ notificationView: NotificationView) {
        print("delegate: notificationViewDidTap")
    }
}

Author

pikachu987, [email protected]

License

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

Latest podspec

{
    "name": "NotificationView",
    "version": "0.2.0",
    "summary": "iOS Notification View",
    "description": "You can easily implement iOS Basic Notification screens.nThere is a default theme and a dark theme.nYou can attach an image to the Notification screen with only the UIImageView.nYou can adjust the disappearance time.nYou can get a delegate or callback for the visible and disappearing states.nYou can get delegates and callbacks for tap.",
    "homepage": "https://github.com/pikachu987/NotificationView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "pikachu987": "[email protected]"
    },
    "source": {
        "git": "https://github.com/pikachu987/NotificationView.git",
        "tag": "0.2.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "NotificationView/Classes/**/*",
    "swift_version": "4.2"
}

Pin It on Pinterest

Share This