I want to convert all the switch statements of SwiftyJSON to if-else conditions, because the switch statements are causing lots of memory leaks.
I've almost converted all the switch-statements, but I gut stuck by this:
fileprivate subscript(sub sub: JSONSubscriptType) -> JSON {
...
switch sub.jsonKey {
case .index(let index): return self[index: index]
case .key(let key): return self[key: key]
}
...
}
public enum JSONKey {
case index(Int)
case key(String)
}
Can someone help me please?