UpperNotificationController 0.1.2

UpperNotificationController 0.1.2

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jul 2016
SPMSupports SPM

Maintained by muukii, muukii.



UpperNotificationController

Usage

1. Define UIView of UpperNotificationViewType

public protocol UpperNotificationViewType: class {

    /**
     - parameter manualDismissClosure: Call this closure to dismiss the notification view
     */
    func didPrepare(dismissClosure: () -> Void)

    func willAppear()
    func didAppear()

    func willDisappear()
    func didDisappear()
}

class MyNotification: UpperNotificationViewType { … }

2. Define class or struct of UpperNotificationAnimatorType

public protocol UpperNotificationAnimatorType {

    func applyPresentAnimation<T where T: UpperNotificationViewType, T: UIView>(notificationView notificationView: T, completion: () -> Void)

    func applyDismissAnimation<T where T: UpperNotificationViewType, T: UIView>(notificationView notificationView: T, completion: () -> Void)
}

struct MyAnimator: UpperNotificationViewType { ... }

3. Create UpperNotificationController

let notificationController = UpperNotificationController()

4. Deliver notification

let notification = NotificationContext<SampleNotificationView> {
    SampleNotificationView()
}

notificationController.deliver(notification: notification, animator: Animator())

Requirements

iOS 8.0+

Author

muukii, [email protected]

License

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