Spanish residency

We are contemplating moving to Spain in the near future.  We hope to move to the L'Albir area of Valencia.  Our next planned visit however is to Mallorca in May.  Can we apply for residency while we are in Mallorca, even though we intend to live in Valencia?

Any advice
David & Joyce

You can only apply for residence status, that is by registering on the EU Citizens Register,  when you are pernanetly living in spain.

If you decide to move here that can in the theory  be from the first day

The application must be made in the Policia National for the area where you are living at the time of the application

Thanks John.  Probably next year before we move out there.  Hopefully Brexit won't cause us any problems.
David & Joyce

The system at present differentiates between EU and non EU.    So after Brexit it may mean that brits are treated as non eu.    That would mean becoming resident would be harder

My wife is non eu so I know from a personal prospective