Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protocol Proto: class {
- var values: [Int] {get set}
- func add(value: Int)
- func showValue() -> [Int]
- }
- extension Proto {
- func add(value: Int) {
- values.append(value)
- }
- func showValue() -> [Int] {
- return values
- }
- }
- class MyClass: Proto {
- //Can we not write this line????
- var values: [Int] = []
- func foo() {
- showValue()
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement