It is common for those who manage or supervise people to swear. There are two key situations when this is most likely to occur, but in both situations it is likely to have the effect of weakening your position of authority.
1. To demonstrate you are angry and serious about an issue
This undermines your authority because it looks like you have lost control of the situation and are flying off the handle. As a manager, you want to appear cool, calm and in control, but as soon as you yell and swear, it tells people that you are desperate and this is a last ditch effort to hold onto that control.
2. To set up an informal environment where people feel comfortable
Although you have the right intentions, many people interpret this as your wish to demonstrate that everyone (including you) is an equal. They may respond to this in ways that you don't feel is respectful of your position of authority, eg. ignore something you ask them to do, pressure you to swap shifts/ tasks. In the workplace, everyone is not equal. You are the boss - so don't accidentally undermine yourself!
It is important to recognise that as the person in authority, your job is to set a standard of professionalism. If you feel uncomfortable with this, remember that employees are proud to work for companies that value professionalism and respect it.