Can a police officer swear at you?

There are probably no departments anywhere that permit their officers to swear at individuals in the course of the officer's work. It is almost universally considered unprofessional conduct.
What happens when an officer swears at a subject is another matter. For anything to happen, a complaint will have to be filed against the officer. Anyone who witnessed the incident may be questioned or asked to fill out a report. Departments have ways to deal with complaints, and have people assigned to investigate them.
Sometimes police and other law enforcement officials find people doing things so offensively stupid or vile that swearing is a reasonable alternative for what they really would like to do.
Sometime they have become aware of the fac that their client group will not understand anything said to them unless it includes at least on cuss word every 10 seconds or so.
Whether or not it is permitted is questionable. There would be some onus on the complainant to prove that he (or she) never used words like that themselves.
Well, my brother is training to be a police officer, so I've read the handbook.. plus spoken to a police officer for a community talk - if your offending the police officer - annoying, insulting, or generally being a nusance, there is no such law saying they cant swear at you. But generally, you wouldn't just find a police officer wondering around swearing - they wouldn't be on great terms, but the answer to your question is Yes, a police officer can swear at you.