What are you really trying to do?
The easiest tack is to write an app, iOS or macOS, that registers 'tftp' as a scheme that it handles. Then, when the user clicks on a tftp://host.tld/exampleFile.txt URL, your app would get called to download the file, storing it in its Documents directory, and giving a directory listing as its U.I.
Once that is working, you'd use NSURLProtocol to claim the tftp scheme, show the user a WKWebView, and when the user taps on a tftp://host.tld/exampleFile.txt URL you fetch the file and just return the NSData up to the WKWebView.
You can look for any open source TFTP package that implements the underlying UDP fetching using BSD networking calls, and that will work on iOS or macOS.
(Sorry for the slow reply - I didn't see your post in my email.)