Could this also be 'I must teach swimming'?
To avoid any confusion, if it is not clear from the context, you would probably say something like:
I fogot to say that that you can use addysgu for 'teaching, educating':
"I have to learn how to swim" should be accepted as the meaning is identical
The meaning of "to learn how to swim" isn't identical. You may acquire information about swimming, but you may not be actually able to swim. That would be Rhaid i fi ddysgu sut i nofio.