Added a check against TARGET_OS_ATV2, which must be defined by the project, to allow avoiding reference to UIKit where necessary