I am beginner with the Swift having no advance knowledge with operators.
Swift
I have the following class
class Container { var list: [Any]
A workaround is to leverage multiple parameters in subscript
subscript
So instead of data[1][2], you can say data[1, 2]. This will be handy in some cases
data[1][2]
data[1, 2]
struct Container { subscript(a: Int, b: Int) -> String { print(a) print(b) return "possible" } } let data = Container() data[1, 2]