Answer:
B. Direct Object
Step-by-step explanation:
A direct object receives the action of a transitive verb. Thus, the infinitive verb to swing is undergoes the action of the verb began.
The rest of the options are incorrect. In the sentence given, to swing does not function as a main verb. Besides, a predicate noun or nominative follows the verb to be and gives information about the subject. Finally, the infinitive verb does not follow a preposition.