Maybe https://developer.apple.com/documentation/uikit/uitextitem will do the job, there's also some info in this WWDC session https://developer.apple.com/videos/play/wwdc2023/10058