There were pigs in Iberia. Not all of the peninsula was conquered, and there were some places that were under the Arabs for only a short time.
And most of the population even in Moslem ruled areas was Christian, so there were pigs.
There are churches that have been in continuous use through the Moslem occupation. There is even a Catholic rite (a version of the liturgy) that is native to the Moslem ruled Christians and is official to this day, the Mozarabic rite.
Short time is relative.
Even Zaragoza, in the far north, was Moslem for 400 years.
Nearly all of Spain was Moslem controlled for at least 200 years. Only small areas, and those remote and poor, were never conquered.