These words can be used interchangeably to mean exchange one thing for another. But "swap" is more restricted in meaning, and "switch" has a much broader meaning and usage. For example, "switch" can be used to mean change from one thing to another, whereas "swap" only means exchange (i.e., give one thing and get something in return).