Was the iPhone invented in 2007 or 1998?

The date the iPhone was invented is June 29 2007
But the first iPod was invented in 1979 but came out to the public in 2007!