Swampert is a Pokemon that hasn't really changed since Gen 4... at least in its base form. Gen 6 gave him access to a Mega evolution that completely transforms his playstyle, changing him from a bulky tank into a potent Swift Swim sweeper. Gen 7 further benefitted Mega Swampert, as he now gets the speed boost from Swift Swim on the turn that he Mega evolves, meaning he doesn't have to run Protect to safely mega evolve anymore, nor does he have to waste a turn of rain using it. It also introduced Drizzle Pelipper, a much better rain setter than Politoed as it can actually support its team outside of just setting rain. Being by far the strongest Swift Swim user with a fantastic typing for rain teams that gives him a key immunity to Electric, Mega Swampert is almost mandatory when making a rain team.
Swampert @
Swampertite
Adamant - Damp
252 Attack, 4 Sp. Def, 252 Speed
-Waterfall
-Earthquake
-Ice Punch
-Stealth Rock
This is Mega Swampert's flagship set, and it's rather simple. Waterfall is his strongest STAB under the rain, and it comes with a healthy 20% chance to Flinch the opponent, which can help break through some bulkier opponents such as Mew. Earthquake is a great secondary STAB that hammers Toxapex and at least discourages Ferrothorn from coming in for free. Ice Punch hits Garchomp hard, and does some damage to Grass-types like Serperior, Tapu Bulu, and Tangrowth. Swampert can also carry Stealth Rock, which can be difficult to fit onto some rain teams as Ferrothorn is already strapped for moveslots. Swampert can also threaten Mega Sableye, although it runs the risk of being burned in the process. If you don't need Swampert to set rocks, Rain Dance, Superpower, and Stone Edge are all solid alternatives. Rain Dance lets Swampert set his own rain, albeit with a shorter duration than Damp Rock Pelipper's rain, Superpower is Swampert's strongest weapon against Ferrothorn, who can otherwise be a massive nuisance to rain teams, and Stone Edge hits Mantine, Gyarados, and opposing Pelipper hard, who can otherwise wall Mega Swampert. Damp is the preferred ability as it stops lead Landorus-Therian and Azelf from using Explosion, but honestly neither base ability is all that useful.
Similar to Kingdra, Mega Swampert is generally used on highly formulaic rain teams, and you'll often see similar partners for the two of them. In fact, Kingdra itself is one of Mega Swampert's most common partners, along with Ferrothorn and Pelipper.
As for regular Swampert, he may not have changed much since Gen 4, and he may not have kept up with power creep very well, but he's still a good pick in lower tiers.
Swampert @
Leftovers
Relaxed - Torrent
252 HP, 252 Defence, 4 Sp. Def
-Scald
-Earthquake
-Stealth Rock
-Roar
This is more or less the same set Swampert has been running for nearly a decade, albeit with Scald occupying the Water STAB slot now. Swampert's great natural bulk and typing makes him a fantastic tank, blanket checking a variety of physical threats, Fire types, and Electric types in the lower tiers. Scald is used as the Water STAB on this set as the chance to burn certain switchins is more valuable than Waterfall's slightly higher damage and Flinch chance, the latter of which he's unlikely to get any use from due to his low Speed. Earthquake is used for when more consistent damage is desired, and to check opposing Electric types that might threaten his team. Stealth Rock lets him support his team with entry hazards, and Roar lets him shuffle the opposing team, racking up hazard damage and preventing him from being setup bait.
Swampert appreciates teammates that can cover his massive Grass weakness. Such teammates may include Scizor, Moltres, and Latias. What he generally offers to a team is a sturdy physical tank who damn near hard counters most of the premiere Electric and Fire types in the tier, such as Rotom-H, Mega Manectric, Infernape, and Raikou, as well as a Stealth Rock user that can threaten some of the tier's premiere Defog users, like Empoleon and Rotom-H. Togekiss is a particularly good partner for Swampert, as Togekiss has no problem checking the Grass types that Swampert fears, while Swampert makes short work of Electric and Rock types that can threaten Togekiss. Togekiss also sponges powerful Dragon moves from the likes of Hydreigon and Latias that can overwhelm Swampert due to its only average special bulk.