Cook announced the surprise visit Monday at the end of his keynote address to the crowd in San Jose. Obama was invited to speak at WWDC and the press was not allowed in.
The second day of Worldwide Developer Conference opened with a conversation with Michelle Obama, first lady of the United States from 2009 to 2017, and Lisa Jackson, Apple's Vice President of Environment, Policy and Social Initiatives.
In order to get more women in tech, "we have to want to", Obama said, according to CNN.
Apple did not immediately respond to a request for comment on if or how much Obama was paid for the talk.
She added that the U.S. is "not out of the clear", as it and other developed nations continue to grapple with issues such as wage inequality and birth control.
Owner of Saks, Lord and Taylor cutting 2000 jobs
And HBC was rumoured in March to be in acquisition talks with distressed high-end department store chain Neiman Marcus. Before the announcement, shares in HBC closed down 11 cents, or 1.13 per cent, to $9.62 on 318,378 shares.
She said she was proud of her husband for living by his values and working harder, better and stronger because he was always trying to be a role model for his team.
Apple closed Obama's speech to members of the press, many of which are on location in San Jose to cover the company's big annual conference. "We buy everything. We make most decisions in the household".
"Think about how somewhere in your work, in your life you're bringing somebody else up", Obama encouraged the audience, which packed the massive convention hall to capacity. "If you do that, we'll be good". Obama also said it's nice to not have to dress up to go outside, and to wake up with nobody in the house.
She then went on to chat about gender equality in the industry and the enormous capabilities of women, saying, "That's where I look to the fellas at the room and say 'Are you ready?"
She ended the talk by advising the audience to think about a "higher goal", stating that the country needs problem solvers "who believe in the values and the diversity, who believe in the value of immigrants, who believe that global warming is real".