Merge pull request #508 from Ericsens/patch-2

put the code to  anterior position
This commit is contained in:
梁杰
2015-10-22 21:18:48 +08:00

View File

@ -837,9 +837,10 @@ if let bowTie = Product(name: "bow tie") {
class CartItem: Product {
let quantity: Int!
init?(name: String, quantity: Int) {
self.quantity = quantity
super.init(name: name)
if quantity < 1 { return nil }
self.quantity = quantity
}
}
```