Added a note on read-only property's setters (#3287)
* Added a note on read-only property setters * re-wrote the part of the setter * looked at the Swift protocol explanation * fixed Obj-C name * made things more laconic
This commit is contained in:
+5
-1
@@ -26,7 +26,7 @@ The table below shows how Kotlin concepts are mapped to Swift/Objective-C and vi
|
|||||||
| `class` | `class` | `@interface` | [note](#name-translation) |
|
| `class` | `class` | `@interface` | [note](#name-translation) |
|
||||||
| `interface` | `protocol` | `@protocol` | |
|
| `interface` | `protocol` | `@protocol` | |
|
||||||
| `constructor`/`create` | Initializer | Initializer | [note](#initializers) |
|
| `constructor`/`create` | Initializer | Initializer | [note](#initializers) |
|
||||||
| Property | Property | Property | [note](#top-level-functions-and-properties) |
|
| Property | Property | Property | [note](#top-level-functions-and-properties) [note](#setters)|
|
||||||
| Method | Method | Method | [note](#top-level-functions-and-properties) [note](#method-names-translation) |
|
| Method | Method | Method | [note](#top-level-functions-and-properties) [note](#method-names-translation) |
|
||||||
| `@Throws` | `throws` | `error:(NSError**)error` | [note](#errors-and-exceptions) |
|
| `@Throws` | `throws` | `error:(NSError**)error` | [note](#errors-and-exceptions) |
|
||||||
| Extension | Extension | Category member | [note](#category-members) |
|
| Extension | Extension | Category member | [note](#category-members) |
|
||||||
@@ -67,6 +67,10 @@ as a Swift extension, because Kotlin has no concept of extension constructors.
|
|||||||
|
|
||||||
Kotlin constructors are imported as initializers to Swift/Objective-C.
|
Kotlin constructors are imported as initializers to Swift/Objective-C.
|
||||||
|
|
||||||
|
### Setters
|
||||||
|
|
||||||
|
Writeable Objective-C properties overriding read-only properties of the superclass are represented as `setFoo()` method for the property `foo`. Same goes for a protocol's read-only properties that are implemented as mutable.
|
||||||
|
|
||||||
### Top-level functions and properties
|
### Top-level functions and properties
|
||||||
|
|
||||||
Top-level Kotlin functions and properties are accessible as members of special classes.
|
Top-level Kotlin functions and properties are accessible as members of special classes.
|
||||||
|
|||||||
Reference in New Issue
Block a user