Generation of a swing electron cyclotron current drive (swing ECCD), i.e. driving alternated, symmetric, positive or negative local ECCD, during a single discharge and at constant total input EC power, was performed at the Tokamak a Configuration Variable (TCV). The electron temperature is observed to be modulated inside the deposition radius, implying modulation of the electron transport properties. The modulation of ECCD is the only actuator for the observed modifications in the electron transport properties. These exhibit inverted behaviors depending on the deposition location of the co- and counter-ECCD. At more on-axis depositions, swing ECCD results in a higher electron temperature during the co- ECCD phase, whereas at more off-axis depositions, the electron temperature is higher during the counter-ECCD phase. Transport modeling of these discharges shows that the local electron tranport behavior depends on the value of the modulated magnetic shear. The results are transport model independent, confirming the robustness of the magnetic shear modeling, and indicating that the main contribution is due to the ECCD. Moreover, the results are consistent with predictions from gyrokinetic simulations, that the local electron confinement is proportional to the magnetic shear at low shear and inversely at high shear values, s greater than or similar to 1.