Making it work for Xcode, credits to Andres Cecilia