Roman numerals do not have a one-to-one mapping to decimal digits. You mapped out the sequences of roman numerals from 1 to 9 (single decimal digits.) There are also roman numerals for 10, 50, 100, 500, and 1000.
If you want to convert a large number in roman numerals to decimal, you need to parse it. You'll need to handle those larger units first.
Map out on paper how you do the conversion yourself, in small steps. Then write those steps out in pseudocode. (Don't worry about syntax, just map out the steps.)
Finally, use your pseudocode as a guide to writing your Swift program.