I recently had to implement something similar, so I put together a basic demo that handles most of these features:
Auto focus
Backspace navigation
Paste support
Input restrictions
Simple UI customization
it is built using SwiftUI along with a use of UIKit to handle backspace navigation and paste support.
Link - https://github.com/jeetrajput01/PinEntrySwiftUI