According to DGT (Spanish National Department of Traffic)
If BREXIT takes place, the United Kingdom will cease to belong to the European Union, so all traffic agreements within the EU will cease to be valid for UK citizens. Among other things, this means that UK licences will only be valid for driving in Spain for the first nine months after BREXIT, provided they are in force.
If you are a resident in Spain and want to continue driving in Spain, it will be necessary to exchange (accredit), renew or replace your licence with an equivalent Spanish one, you must submit the original.
The DGT is implementing a protocol that allows you to exchange your UK licence for the Spanish equivalent under the same conditions pre- BREXIT, without having to wait for the signing of a new agreement between countries, or having to obtain a new Spanish driving licence.
To proceed with a driver’s licence exchange, you must hold a UK driving licence, be a resident in Spain and submit an application before 1 November 2019.
Once you have initiated the exchange process, your original license will be withdrawn and you will be given a provisional permit. It will take approximately one and a half months to receive your new, definitive licence, which will be sent by post.
The deadline for requesting the exchange is October 31 2019.
As of the November 1 residents with UK licences will have to pass a Spanish driving test
You can still use your Spanish licence in the UK for short visits or exchange it for a UK licence without taking a test if you return to live in the UK.