Implemented generator of swift code

I think here we have particular type of array item and it would be useful to use it here, not AnyObject