John Ternus, who has long focused on design and products at Apple, will lead the iPhone maker as it gears up for an industry change spurred by artificial intelligence.