From 3dd9becb0fb3a350644aad3607e64dae58299ffd Mon Sep 17 00:00:00 2001 From: Chen Yufei Date: Sat, 30 Oct 2021 17:26:41 +0800 Subject: [swift/en] fix typo about break statement in loop (#4258) Just a small fix. --- swift.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'swift.html.markdown') diff --git a/swift.html.markdown b/swift.html.markdown index 39a5cc52..0e68e65f 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -334,7 +334,7 @@ repeat { } while i < 5 // The continue statement continues executing a loop at the next iteration -// The break statement ends a swift or loop immediately +// The break statement ends a loop immediately // MARK: - Functions -- cgit v1.2.3 From d24f135208ca072eb7be3320c1221d192d65c9cf Mon Sep 17 00:00:00 2001 From: Xing Zheng Date: Tue, 4 Jan 2022 00:16:36 +0800 Subject: fix a typo (#4172) the variable name should be `someIdentifier` instead of `willSet`. --- swift.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'swift.html.markdown') diff --git a/swift.html.markdown b/swift.html.markdown index 0e68e65f..e46dcc75 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -654,7 +654,7 @@ class Rect: Shape { // but still want to run code before and after getting or setting // a property, you can use `willSet` and `didSet` var identifier: String = "defaultID" { - // the `willSet` arg will be the variable name for the new value + // the `someIdentifier` arg will be the variable name for the new value willSet(someIdentifier) { print(someIdentifier) } -- cgit v1.2.3 From b8d2f410a838c49836e2572c8a3c682709153671 Mon Sep 17 00:00:00 2001 From: Edoardo La Greca <35077726+EdoardoLaGreca@users.noreply.github.com> Date: Sat, 10 Feb 2024 14:37:32 +0100 Subject: [swift/en] describe convenience initializers (#4836) --- swift.html.markdown | 3 +++ 1 file changed, 3 insertions(+) (limited to 'swift.html.markdown') diff --git a/swift.html.markdown b/swift.html.markdown index e46dcc75..36124e11 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -679,6 +679,9 @@ class Rect: Shape { // A simple class `Square` extends `Rect` class Square: Rect { + // Use a convenience initializer to make calling a designated initializer faster and more "convenient". + // Convenience initializers call other initializers in the same class and pass default values to one or more of their parameters. + // Convenience initializers can have parameters as well, which are useful to customize the called initializer parameters or choose a proper initializer based on the value passed. convenience init() { self.init(sideLength: 5) } -- cgit v1.2.3