Skip to content

Commit ab72b99

Browse files
committed
[docs] CToSwift: Tweak wording around "overrides"
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!)
1 parent 618afde commit ab72b99

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/CToSwiftNameTranslation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ Objective-C methods are classified into one of five categories:
228228

229229
5. Other methods are imported as plain methods.
230230

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.
232232

233233

234234
### Normal Initializers
@@ -454,7 +454,7 @@ Certain method parameters are automatically considered to have default argument
454454

455455
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.
456456

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.
458458

459459
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".
460460

@@ -479,7 +479,7 @@ _Objective-C code has historically not been consistent about whether the NSAcces
479479

480480
## `swift_private`
481481

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.
483483

484484
```objc
485485
@interface Example : NSObject

0 commit comments

Comments
 (0)