PGNotificationView 1.0.0

PGNotificationView 1.0.0

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布上次发布2021 年 3 月
SPM支持 SPM

suwan.park 维护。



  • ipagong.dev

PGNotificationView

示例

要运行示例项目,首先克隆仓库,然后在 Example 目录中运行 pod install

appetize.io 演示 : [这里]

它是一个通知视图创建器(uiwindow)。

只需发送您的自定义视图和一些配置,然后调用 show()。

它是一个非常舒适的通知视图。

1. 创建 > 显示

NotificationView.create(YourNotiView("hello")).show()

2. 创建 > 设置(持续时间)> 显示

NotificationView.create(YourNotiView("hello")).setupDuration(present: 0.3, dismiss: 0.3, expose: 3).show()

3. 创建 > 设置(触摸)> 显示

NotificationView.create(YourNotiView("hello")).whenTouch { view in
    print("third notification touched.")
}.show()

4. 创建 > 设置(完成)> 显示

NotificationView.create(YourNotiView("hello")).whenCompletion { completed in
    print("hide completion.")
}.show()

5. 创建 > 组合设置 > 显示

// you can choose setup methods.
NotificationView.create(YourNotiView("hello"))
  .setupDuration(present: 0.3, dismiss: 0.3, expose: 3)
  .whenTouch { view in
      print("third notification touched.")
  }.whenCompletion { completed in
      print("hide completion.")
  }.show()

6. 查找尚未 deinit 的旧通知视图。

//find last.
NotificationView.find(YourNotiView.self)?.hide()

//find all type.
NotificationView.findAll(YourNotiView.self)?.forEach({ notiview in
    // do something.
})

要求

  • ios 8.0 以上
  • swift 3.0
  • 配合 cocoapods

安装

通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中:

pod "PGNotificationView"

作者

ipagong, [email protected]

许可证

PGNotificationView 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。