Spain has more than 5,000 miles of beautiful coastline; most of this is adorned by equally beautiful beaches. Some of these rank among the greatest in the world. There were no beaches in Barcelona until 1992. The seaside of Barcelona was full of local industries up until the city decided to host the Olympic Games.
Source: http://www.apartime.com/blog/culture-tourism/10-interesting-facts-about-barcelona, https://spainguides.com/spain-travel-guide/best-beaches-spain/