Titanium: Android toast-like notifications in iPhone

In a recent project I worked with Titanium Appcelerator, a plattform to code once (using a  Javascript-API) and publish twice (iOS and Android). So goes the story… In real life it is not sooooo easy, because while you are coding you realize that iOS and Android do have some differences. :)

For example: a little growl-like notification-window which fades out after a few seconds. For Android there is a Titanium-API-function, for iOS not.

Anyway, I just wanted to share a function which works for both:

Source: http://developer.appcelerator.com/question/137662/android-toast-notification-in-iphone