Official language

Barcelona's official languages are Catalan and Spanish. However, most signs are only in Catalan because it is established by law the official language. Yet, Spanish is also widely used in public transports and other facilities.
Catalan is spoken by approximately 50-60% of the inhabitants of Barcelona. Spanish is spoken by 98% of people living in the city.

Speaking English in Spain

In tourist areas, almost all shops and restaurans have some English speaking staff. However, like in the rest of Spain, English is not widely spoken, though it's still more widespread in Barcelona than in the rest of Spain, and you are more likely to encounter an English speaker in Barcelona than in Madrid. People will generally make an effort to try to help you if you speak in English, but their vocabulary will be very limited.
Before you are visiting Barcelona, it is best way to learn a few Spanish.