This is a known issue I have faced before but my previous solution is not working on iOS 14, so the white cancel button is invisible against a white background. I have tried alternatives that worked for previous versions, but none work on iOS 14.
This is what used to work and doesn't anymore:
UIBarButtonItem.appearance().setTitleTextAttributes([.foregroundColor: .black], for: .normal)