You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The previous wording referred to a method or property satisfying a
protocol requirement as an "override", which both Clang and the Swift
Clang Importer use internally sometimes. But most people who program
Objective-C (or Swift) don't think of this as an override, so this
document shouldn't use that language. (Thanks, Varun!)
Copy file name to clipboardExpand all lines: docs/CToSwiftNameTranslation.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -228,7 +228,7 @@ Objective-C methods are classified into one of five categories:
228
228
229
229
5. Other methods are imported as plain methods.
230
230
231
-
If a method overrides a superclass or adopted protocol method, the Swift name of the overridden method will be used for consistency. If there's more than one such name, one is chosen arbitrarily.
231
+
If a method overrides a superclass or matches a method in an adopted protocol, the Swift name of the "overridden" method will be used for consistency. If there's more than one such name, one is chosen arbitrarily.
232
232
233
233
234
234
### Normal Initializers
@@ -454,7 +454,7 @@ Certain method parameters are automatically considered to have default argument
454
454
455
455
Property names are transformed according to the "omit needless words" process described in [CToSwiftNameTranslation-OmitNeedlessWords.md][]. This process attempts to omit superfluous type names and other words that make a name fit the Cocoa Naming Guidelines for Objective-C but not the Swift API Design Guidelines. The transformation is based on the property's type and the type of the enclosing context.
456
456
457
-
If the getter of a property overrides a superclass or adopted protocol method that is also a property accessor, the Swift name of the overridden accessor's property will be used for consistency. If there's more than one such name, one is chosen arbitrarily.
457
+
If the getter of a property overrides a superclass method or matches a method in an adopted protocol that is also a property accessor, the Swift name of the "overridden" accessor's property will be used for consistency. If there's more than one such name, one is chosen arbitrarily.
458
458
459
459
Properties with the type `BOOL` or `Boolean` use the name of the getter as the name of the Swift property by default, rather than the name of the property in Objective-C. This accounts for a difference in Swift and Objective-C naming conventions for boolean properties that use "is".
460
460
@@ -479,7 +479,7 @@ _Objective-C code has historically not been consistent about whether the NSAcces
479
479
480
480
## `swift_private`
481
481
482
-
The `swift_private` Clang attribute prepends `__` onto the base name of any declaration being imported except initializers. For initializers with no arguments, a dummy `Void` argument with the name `__` is inserted; otherwise, the label for the first argument has `__` prepended. This transformation takes place after any other name manipulation, unless the declaration has a custom name. It will not occur if the declaration is an override; in that case the name needs to match the overridden declaration.
482
+
The `swift_private` Clang attribute prepends `__` onto the base name of any declaration being imported except initializers. For initializers with no arguments, a dummy `Void` argument with the name `__` is inserted; otherwise, the label for the first argument has `__` prepended. This transformation takes place after any other name manipulation, unless the declaration has a custom name. It will not occur if the declaration is an override or matches a protocol requirement; in that case the name needs to match the "overridden" declaration.
0 commit comments