From 7454df6159f817e3a551a3e55355d1ab3cca59bc Mon Sep 17 00:00:00 2001 From: Zee Ma Date: Thu, 22 Oct 2015 20:08:56 +0800 Subject: [PATCH] put the code to anterior position correct code exist in the wrong place, it will lead a compiling warning --- source/chapter2/14_Initialization.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/chapter2/14_Initialization.md b/source/chapter2/14_Initialization.md index e79a04a9..31a9c054 100755 --- a/source/chapter2/14_Initialization.md +++ b/source/chapter2/14_Initialization.md @@ -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 + } } ```