The highlighted background shows the size of the UILabel text element. I’ll see if I can make a better video for this to show some code, though this is from quite awhile ago now, so I may have to remake it.
Written with Xcode, in Swift, for iOS. All UIKit. SwiftUI didn’t exist at the time.
Take the opportunity to connect and share this video with your friends and family if you find it useful.