CGFloat and Double should be interchangeable since this has been implemented in Swift 5.5:
CGFloat
Double