Last active
July 23, 2019 09:28
-
-
Save zakbarlow1995/4475a95d8b2b09f351b192820d821555 to your computer and use it in GitHub Desktop.
Overloading Swift Operators: CGFloat * CGSize
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
func * (lhs: CGSize, rhs: CGFloat) -> CGSize { | |
return CGSize(width: lhs.width * rhs, height: lhs.height * rhs) | |
} | |
func * (lhs: CGFloat, rhs: CGSize) -> CGSize { | |
return CGSize(width: lhs * rhs.width, height: lhs * rhs.height) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment