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 { … }
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 { ... }
let notificationController = UpperNotificationController()
let notification = NotificationContext<SampleNotificationView> {
SampleNotificationView()
}
notificationController.deliver(notification: notification, animator: Animator())
iOS 8.0+
muukii,[email protected]
UpperNotificationController 可在 MIT 许可协议下使用。有关更多信息,请参阅 LICENSE 文件。