A Silicon Valley courtroom has heard how some of the iPhone's most recognisable software features came from a team working in a dark, dirty, windowless room with special security to keep others out.

The story of the iPhone's software design was related by Greg Christie, an Apple vice president and software designer, on Friday as part of Apple's patent infringement case against Samsung. Christie is one of the inventors listed on the patent for the "slide to unlock" function, which is one of the patents in question in Apple's lawsuit against Samsung, on trial in the U.S. District Court in San Jose, California.

Christie engaged the jury and courtroom with his behind-the-scenes tale of his part in the development of the phone, which began with a knock on his office door.

"One day, I was sitting in my office, and Scott Forstall came in, shut the door, and he asked me, 'How would you like to do a phone?'" Christie recalled of the first time he heard of Apple's ambitious plan. Forstall was leading some of Apple's OS X design at the time.

"I said, 'Sure, you bet,' and we started to discuss it a bit further," he said "It was a pretty general description at the time, but it would be touch-based, have a large screen for a phone, but a very small screen for a desktop computer, and my team should start working on designs for it."

How Apple developed the iPhone

Over the next few months, Christie's team would demonstrate ideas they had for elements of the iPhone software at the end of meetings focused on OS X design that took place every couple of weeks.

"We'd work on small designs, brainstorm, demonstrate them and review. That went on for a few months," he said.

The meetings took place in a room on the second floor of the building where Christie worked that was reserved for meetings with Steve Jobs.

"It had special security, a PIN code to open the door, there were no windows," Christie said of the room.

At the start, everything seemed to be going well, but that changed in January 2005, just after the Macworld conference.

"Steve was pretty frustrated by what he perceived as a lack of progress on the work," said Christie. "He made himself pretty clear."

Christie's team was given an ultimatum: They had until the next meeting to put together an end-to-end demonstration that showed all of the disconnected experiences working together, or the project would be given to another team at Apple.

"I felt a little angry. I felt we had been making progress," he said. "I felt very competitive, I didn't want to lose this project to another team. I really wanted to do a good job on this."

Bringing it all together

What followed was two weeks of almost continuous work.

"Pretty much nothing else mattered over the next two weeks," he said.

The demonstration in front of Jobs took place in the same, windowless room the team had been using all along. A tower Mac computer was running the software connected to a small LCD screen with touch interface to provide Apple's founder a taster of what consumers wouldn't see for the next two years.

It was a success.

"This was clearly what he was looking for and that he had been asking for. He thought it was great work," said Christie.

Before long, additional security was added and keycards were required to access the corridor where Christie and his team worked. Similar measures were taking place across Apple as other teams began working on different aspects of the iPhone.

It was to be a long, tough two years.

"It was exhausting and it was exciting. From 2005 through to the announcement in January and sale in June 2007, it was pretty much nonstop. You had to be prepared to discuss what you were working on at anytime of the day, any day of the week, any week of the year," he said.

After two years, the iPhone launches

When the day of the unveiling came, Christie was in the audience at Macworld Expo 2007 in San Francisco. Apple's phone had become the subject of considerable speculation and anticipation in the months leading up to the event.

"It was nerve-wracking, we all wanted it to go perfectly. There was a lot of anticipation, we were hoping we were right and that people would get it," Christie said of the feeling among his team.

And consumers did get it.

As soon as the iPhone was launched, Apple saw massive interest. People camped outside stores to buy it and lines stretched around the block at many AT&T stores.

Christie says he went to work that day, stopping at the supermarket to buy "a few bottles of decent champagne" and then celebrated with workers in the office. In the evening, he went for dinner with his family and then drove around to AT&T stores to look at the long lines of people waiting to buy the phone.

"It was astonishing. We knew for at least one day we were a huge success and it had hopefully all been worth it," he said.