Traditional grammar would parse this sentence as:
[Subject I] [Verb asked] [Indirect Object him] [Direct Object if he could swim]
Observe, however, that Indirect Object is not equivalent to Recipient. Indirect Object and Direct Object are syntactical categories: the names for different roles in the sentence. Recipient is a semantic or thematic category: the name for a particular role in the action described.
The distinction is important because syntactical categories may change when the sentence is “transformed”, while semantic categories remain constant. For example, if your sentence is recast into the passive voice, HE (with necessary inflectional changes) becomes the Subject of the sentence:
[Subject He] [Verb was asked] [Direct Object if he could swim]
But the person designated by he is still the Recipient of the action.
It is perhaps worth noting that in an ordinary active sentence, the syntactic role of Indirect Object may also fill the semantic role which Functional Grammar names Beneficiary:
[Subject I] [Verb bought] [Indirect Object him] [Direct Object a necktie]