Making code work with both iOS and tvOS apps