This video provides a SwiftUI solution https://www.youtube.com/watch?v=dAt8qh4xi9I
(I understand SO wants code copy/pasted here. It's not my responsibility and I won't steal this video creator's traffic to help a PE-owned business. Someone else can do that if they like, or delete this working answer if they don't.)