No, swimming is not mandatory for participating in scuba diving. You are usually in the hands of expert divers and fitted with scuba gear with a supply of oxygen. The trainer will train you on the breathing techniques which is simple enough. And once you get used to breathing in through mouth and breathing out through nose you are ready to dive into the depths.