Swallows (which includes swallows, house and sand martins) can breed much later than most other UK birds -- into October sometimes. They arrive in April and have brood after brood until the weather breaks.
So they could leave any time now -- our own swallows went last week.
European swallows species go to Africa, where there is still insect food during our winter.
Swifts are not closely related to swallows (but to hummingbirds), and visit us for a much shorter time (May to August). They may have one or two broods of young.
Why do either of them come here at all? Because in Africa they have to share the food with a couple of dozen other species of swallows and swifts, and there's no such competition here for our abundant summer insects.