The timing of those talks depends on the source you believe. According to the New York Times, it was "in recent months." The Wall Street Journal, on the other hand, says the talks took place over a year ago.
In addition, while the NYT article seems to indicate that the firms are still in discussions - it's really unclear, but the tone of the article points in that direction - the WSJ states that there are no current formal investment - or acquisition - discussions between the companies.
Twitter's most recent round of private investment funding valued at the company at $8.4 billion. The NYT report said Apple's investment Twitter would have amounted to hundreds of millions of dollars, and could have valued Twitter at more than $10 billion.
Apple doesn't have its own social networking service, and Ping, its attempt to integrate social with iTunes has flopped and will be eliminated with the next major release of iTunes.
Microsoft, on the other hand, has a stake in Facebook and Google has its own Google+ service. But does Apple need its own service?
At a recent technology conference, Apple CEO Tim Cook said, “Apple doesn’t have to own a social network. But does Apple need to be social? Yes.”
With integration into iOS and even Mac OS X, Apple has made moves in that direction. Will it go still further, with an investment in Twitter? Time will tell.