ABKInAppMessageWindowController is the view controller responsible for housing and displaying ABKInAppMessageViewControllers and performing actions after the in-app message is clicked. Instances of ABKInAppMessageWindowController are deallocated after the in-app message is dismissed.
It will display the given in-app message view controller by animating it onto the screen, and dismiss it by animating it off the screen, by calling the ABKInAppMessageViewController's moveInAppMessageViewOffScreen: and moveInAppMessageViewOnScreen: methods, and log an impression of the in-app message. If the in-app message view controller is an instance of ABKInAppMessageSlideupViewController, ABKInAppMessageModalViewController, or ABKInAppMessageFullViewController, it'll also handle the following behaviors:
- For ABKInAppMessageSlideupViewController:
- set the width of the view controller based on slideup UI style and iPhone devices.
- add a tap gesture recognizer to the in-app message view controller, and handle the clicks on it.
- add a pan gesture recognizer to the in-app message view controller, and handle the panning on it.
- For ABKInAppMessageModalViewController:
- set the background color to be black with alpha 0.9.
- move the in-app view controller to the center.
- when the in-ap message has no buttons, add a tap gesture recognizer to the in-app message view controller, and handle the clicks on it.
- block the clicks outside of the in-app message view.
- For ABKInAppMessageFullViewController:
- set the in-app message's frame to be full screen.
- when the in-app message has no buttons, add a tap gesture recognizer to the in-app message view controller, and handle the clicks on it.
Additionally, the view controller is responsible for executing that in-app message's specified behavior on click or performing a "custom action", which can be specified through a delegate for the in-app message.
After the in-app message is dismissed, ABKInAppMessageWindowController will set the inAppMessageWindow property to nil, and inform ABKInAppMessageUIController to set it's windowController property to nil as well. At that point, the in-app message window's retainer count will drop to 0 and the system will clean it out from the UIApplication's windows array.