Created
December 30, 2020 10:45
-
-
Save mzeeshanid/9748fb3710575416b760dd0f50501638 to your computer and use it in GitHub Desktop.
Product extension
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
extension Product { | |
func startingPrice() -> Double { | |
return self.variants.min(by: {$0.price < $1.price})?.price ?? 0.0 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment