要运行示例项目,先克隆仓库,然后从Example目录中运行pod install
。
InAppNotification为您提供了一种简单的方式,以iOS原生类似通知的形式显示应用内通知。
显示一个简单的通知,无图片
InAppNotification.sharedInstance.showNotification("Notification Title", message: "Notification message. Without image.")
您也可以显示一个包含自定义图片的通知
InAppNotification.sharedInstance.showNotificationWithImage(UIImage(named: "your-image"), title: "Notification title", message: "Notification message. Default configuration is numberOfLine = 2.")
最后,您可以设置自定义视图,并通过使用didShowCustomViewBlock
、didHideCustomViewBlock
和didDragCustomViewBlock
来设置回调以控制此视图何时显示、隐藏或拖动。
Alex,[email protected]
InAppNotification可在MIT许可下使用。请参阅LICENSE文件以获取更多信息。