Access control blocks for Swift code
| Originator: | DanielMiedema | ||
| Number: | rdar://20764537 | Date Originated: | 4/30/2015 |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | |
| Classification: | Reproducible: |
Summary:
It would be nice if instead of having to specify `private` or `internal` for every property in Swift I could lump them into a block.
For example,
class Foo {
// public by default
var repeatCount = 3
private {
let maxRepeatCount = 100
var secretMessage = "you can't change this"
}
...
}
Instead of having to write,
class Foo {
// public by default
var repeatCount = 3
private let maxRepeatCount = 100
private var secretMessage = "you can't change this"
...
}
Steps to Reproduce:
1. Create any Swift class/struct.
2. Create some private properties
3. Notice each one has to begin with `private`
Expected Results:
I could lump all `private` properties into a block of some kind
Actual Results:
I have to type `private` before each property
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!