Be it pre-1900 or after, the UK decides - to improve relations with Spain (or bribe it to do something) to swap Gibraltar for Ceuta.
Or maybe, post WWI (WWII?), Britain deems Gibraltar simply too small - not enough space for naval facilities, stores, staging ground for troops, airfields, whatnot.
Is such a swap worthwhile?
The African territory is three times as large, 6,5km3 versus 18km3.
The territory's core is - like Gibraltar - located on a small promotory.
Let us put tradition and investment to date aside.
What does Gibraltar have that Ceuta does not? What Ceuta has - or can have - that Gibraltar cannot?
Space for airfield (Ceuta IMO better)?
Which has a better anchorage?