I implemented the same feature by using this lib:
https://github.com/tobihagemann/THLabel
However, I have to do more. If your label displays a complex attributed string with some attributes like underline, strike through, this lib will not help you to solve completely.
I've changed a bit in draw(_:)
to only manually draw a filled image based on the main text shape that seems to look like an outer stroke.
https://github.com/dungntm58/THLabel/blob/swift/THLabel/THLabel.swift
Unfortunately, it does not work properly in some cases. I hope it will help you to solve your issue.
Edit: I updated my code to solve a lot of issues about label shadow, I think it will work perfectly.