Why would they say to stop swearing if that was not the case.
Why argue with Policemen its a stupid thing to do as they will always win in the end...
I agree. Just do as they say and get on with your life. If you`d just say ok sorry then thats it and no one is angry or stressed.
Respect works both ways doesn`t it and argueing with them doesn`t help.
Bear that in mind for the future.