The wings of swallows and dragonflies perform the same function: they enable the organisms to fly but it does not mean that these organisms belong to same common ancestor.
They have actually analogous structure.
Analogous structure:
Analogous structures are those structures in different species which perform the same function, have similar appearance and structure but are not evolved together; therefore do not share a common ancestor.