Rian Johnson, the director of hit whodunit movie "Knives Out," recently sat down for an interview with Vanity Fair to break down a scene from the film.

Johnson says that while Apple allowed the movie to feature an iPhone in the scene, the company doesn't allow "bad guys" to have the phone on camera.

As part of Apple's guidelines, third parties can only show products "in the best light" and "in a manner or context that reflects favorably" on the company.

TV viewers have noticed that Apple products often are only seen in the hands of good guys on screen, notably in the once-popular TV drama "24."

Visit Business Insider's homepage for more stories.

A rule Apple enforces for iPhone cameos in movies and TV shows may be the key in spoiling whether your favorite character is a hero or a villain.

Apple has strict rules for on-screen appearances of its products, according to Rian Johnson, the director of modern mystery film "Knives Out." Johnson told Vanity Fair in a recent interview that while Apple allows for product placement of Macs and iPhones in movies, the company has a golden rule: bad guys can't have Apple products.

"I don't know if i should say this or not. Not because it's like lascivious or something, but because it's going to screw me on the next mystery movie that I write," Johnson said in the interview. "Apple, they let you use iPhones in movies, but — and this is very pivotal if you're ever watching a mystery movie — bad guys cannot have iPhones on camera." Apple did not immediately respond to a request for comment on Johnson's remarks.

Mild "Knives Out" spoiler ahead.

Johnson's "Knives Out" featured an Apple product in at least one scene, in the hands of Linda Drysdale, played by Jamie Lee Curtis. We won't spoil the movie for you, but you can make your own conclusions about Curtis' character in the whodunit, murder mystery movie.

This association has been repeatedly reinforced and depicted over years of movies and TV shows: good guys own iPhones and Macs, the bad guys have PCs and Androids. Viewers have long speculated about this, and have pointed it out in "24," the wildly popular 2000s show starring protagonist Jack Bauer.

Revered movie critic Roger Ebert even remarked on the phenomenon back in 2003.

"Since many Windows machines look alike, Apple is one of the few manufacturers that can gain by product placement," Ebert wrote in a column for the Chicago Sun-Times.

The requirement to depict Apple positively is written right into the company's legal guidelines for third parties using Apple trademarks and copyrights. Apple states that its products must be shown "only in the best light, in a manner or context that reflects favorably on the Apple products and on Apple Inc."

Apple's strict oversight of movie and TV shows is something that's also been noticed in production of content for the company's new streaming service, Apple TV+. Apple executives were reportedly "intrusive" when it came to content, encouraging producers to exclude explicit or mature content in favor of more "family-friendly" content.