TAIWAN—Apple Inc.’s contract manufacturer for chipsets for its iPhones, Taiwan Semiconductor Manufacturing Co., has been hit by a virus attack and production badly affected. Sources for the manufacturing company indicate that this was not a cyberattack by any outside hacker and to that extent, sabotage is not suspected.