put the code to anterior position
correct code exist in the wrong place, it will lead a compiling warning
This commit is contained in:
@ -837,9 +837,10 @@ if let bowTie = Product(name: "bow tie") {
|
|||||||
class CartItem: Product {
|
class CartItem: Product {
|
||||||
let quantity: Int!
|
let quantity: Int!
|
||||||
init?(name: String, quantity: Int) {
|
init?(name: String, quantity: Int) {
|
||||||
|
self.quantity = quantity
|
||||||
super.init(name: name)
|
super.init(name: name)
|
||||||
if quantity < 1 { return nil }
|
if quantity < 1 { return nil }
|
||||||
self.quantity = quantity
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user