What is the IGOverlayView?
The IGOverlayView is a powerful and extremely flexible control for displaying any type of view that will overlay another view, with or without animation, when shown or dismissed. A total of 12 overlay animations are included, with 2 of these animation types allowing for custom animations limited by your imagination.
What is a Toast Message?
A toast message is an brief auto-expiring information dialog. Typically used in mobile devices to show visual feedback when turning the volume up/down or application actions such as notifying the user a file has saved.
How Do I Create a Toast Message Using the IGOverlayView?
The first step in creating a toast notification is to initialize the IGOverlayView. The IGOverlayView will provide the transparent dark appearance over a view and animate the toast message to and from the screen.
Next, initialize a UILabel with a fixed size and a white background to serve as the toast message. The center property is also set to place the toast message directly in the center of the view. After configuring the UILabel is added as a subview of the IGOverlayView.
How Do I Display the Toast Message?
To display the toast message we need to set the message text and the duration of the message.
Next the IGOverlayView is animated into view and using the Dispatch API the IGOverlayView will automatically dismiss itself.