I want my PC to be able to choose between swinging a sword or casting a spell. Can he be ready to do either? That is, on my sorcerer's turn, can he be ready to swing a sword or cast a spell, or does holding a spellcasting focus preclude wielding a weapon?
Yes, you can be prepared to Cast or Attack when "dual-wielding" like this
A spellcaster must have a hand free to access a spell's material components--or to hold a spellcasting focus -- but it can be the same hand that he or she uses to perform somatic components.
Therefore, you can do all spell gestures and provide material components using just one hand.
You can even do this with a two-handed weapon
Two-Handed (p. 147). This property is relevant only when you attack with the weapon, not when you simply hold it.
Since letting go with one hand does not take any item interaction or action, you can release your two-handed grip to grab your focus and cast a spell as well.
You aren't able to cast Non-Material component spells, however
Sage Advice has clarified that spells with Somatic, but no Material components cannot be cast while wielding a spellcasting focus without another free hand.
In either of these scenarios (1h or 2h weapon) it's pretty easy to simply pocket your focus (or let it dangle on a chain around your neck) before casting however.
Nowhere does it say or imply that a spellcasting focus requires the use of two hands. However, having both hands occupied would impede the need for a free hand to cast spells with a somatic component but no material component.
By using a component pouch instead of a spellcasting focus, a sorcerer can hold one weapon and have one hand free to cast spells with either or both of a material or somatic component. Only one free hand is required, so the sword does not impede spellcasting.