Spread mayonnaise on one side of each slice of bread.
With mayo side down, lightly spread 4 slices of bread with Dijon mustard, evenly top each with Swiss cheese, ham slices, folded to fit, and pickle slices.
Place the remaining 4 bread slices on the sandwiches, mayo side up, and lightly press sandwiches to close.
Preheat the air fryer to 380 degrees F (193 degrees C). Spray the air fryer basket with cooking spray or line with a parchment liner.
Place sandwiches in the air fryer basket in a single layer, leaving some space around them.
Cook until sandwiches begin to brown, 3 to 4 minutes.
Flip, and cook until cheese has melted and sandwiches are golden brown, 2 to 3 minutes more.
Slice sandwiches in half and serve warm.
