It is really quite simple..
You get a written proof from the DVLA you have entitlement to a license and have passed the test in the UK.
You then use this to apply to swap to your current EU locality license, which you MUST do.
You then get a license in the country you reside in.
Be careful, this ain’t 1999 anymore Spain and most/many other countries Police and Traffic systems are now linked together. Taffico here in Spain can instantly pull up your car details (insurance, mot, tax) and full driving license details at the side of the road.
-K