A class that displays a message that disappears similar to a toast but with the touch of iOS
A helper class that displays a small view that shows a message to a user and disappears. Sounds Famailiar to a toast right? But guess what it has UIKitDynamics involved.It supports the following:
- toast can be moved around via pan
- swipe the info view down and it is pushed out of the screen
- slowly try to move the info view to the bottom and it is automatically moved out of the screen
- dynamically resizes based on content
- its can be customized, to be specific everthing i.e image , title color,font and bgcolor
private lazy var infoViewManager:InformationViewManager = {
return InformationViewManager(parentView: self.view)
}()
where parentView is UIViewController.view or the container view in which the toast has to be displayed
and finally
let dataModel = InformationViewDataModel(image: UIImage(named: "checkmark"), description: "This is a sample test This is a sample test", backgroundColor: UIColor.black, titleColor: UIColor.white, font: UIFont.systemFont(ofSize: 12))
self.infoViewManager.showUsing(dataModel: dataModel)
thats it!