Counter target spell. Create X Treasure tokens, where X is that spell's mana value. (They're artifacts with "{T}, Sacrifice this artifact: Add one mana of any color.")
For spells with {X} in their mana costs, use the value chosen for X to determine the spell's mana value.
You may target a spell that can't be countered. When Spell Swindle resolves, the target spell will be unaffected, but you'll still get Treasures.