I did implement class which use subscript and return objects like following:
class PlacesSet {
...
subscript(i: Int) -> Place {
get {
return stored[i];
}
set {
stored[i] = newValue;
}
}
}
But when I try to pass it as array in some cocoa function it returns error. Should I implement some protocol and missing methods? And is it possible to do in general?