We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example:
class Foobar { private _value = 0; public get value() { return this._value; } private set value(value: number) { console.log(`setting value to: ${value}`); this._value = value; } public doSomething() { this.value = this.value + 1; } }
You can do that for example in Objective-C, where it's really useful:
Foobar.h
@interface Foobar : NSObject @property (readonly, nonatomic) int value; - (void)doSomething; @end
Foobar.m
@interface Foobar () { int _value; } @property (readwrite, nonatomic) int value; @end @implementation Foobar - (int)value { return _value; } - (void)setValue:(int)value { NSLog(@"setting value to: %d", value); _value = value; } - (void)doSomething { self.value = self.value + 1; } @end
The text was updated successfully, but these errors were encountered:
Duplicate of #2845
Sorry, something went wrong.
No branches or pull requests
Example:
You can do that for example in Objective-C, where it's really useful:
Foobar.h
Foobar.m
The text was updated successfully, but these errors were encountered: