Dejian Zeng, an NYU grad student worked undercover in a Pegatron iPhone factory in Shanghai for six weeks and explains what the factory would do to prevent leaks as they transitioned into working on the iPhone 7.
While continuing to produce the iPhone 6s, the new facilities to build the assembly line for the iPhone 7 was kept hidden with a big curtain that blocked everything. Workers were then moved out of the facility into another sub-factory building, so that the new assembly line can be erected before moving back in.
In terms of security and preventing theft of iPhones, workers were provided with a locker room, where they had to leave their phones and all metal objects, while also changing into their work attire. Special key cards, passing a facial recognition test and entrance to two metal detector screenings were also implemented to further heighten the security.
Additionally, Zeng pointed out that high-level managers were actually able to bring their phone in the factories, hence providing sources with leaked info on upcoming iPhones. While there are cameras in the workshop, there were some cases where workers tried to carry iPhones out of the factories and got caught. With this occurrence, Zeng noted that security and Apple audits went up between the iPhone 6s and iPhone 7 production.