Usually for a student to escalate at that point there has to be some kind of frustration caused by either content or other outside factors. I am not there to get personally offended by the swears, I know they are let out to express the frustration and anger. I would really really try to assess that situation and leave any of my feelings out.
I see that you are very angry and upset at this time, and I wouldn't want to add to more to those feelings. Could we please step outside the classroom to have a quick talk?
If the students agrees to come in the hallway by the classroom door, I'd ask:
"I know you are mad right now. And I really want to help you if I can. What is going on? What are you feeling? Or
I apologize if I did anything or contributed to this situation. How can we work through this? What can I do to help you though this? Your input is really important in my classroom.
I really need you in class. Can we make it work?