问题 I have a multi-level dictionary that I need use to build navigation links. Now I have a 2-level depth dictionary: let multiDimDict: [String: [[String: [String]]]] = ["A": [["A1": ["A11", "A12"]], ["A2": ["A21", "A22"]]], "B": [["B1": ["B11", "B12"]], ["B2": ["B21", "B22"]]] ] I can build the navigation view with all navigation links. However, I feel that I am somehow repeating some code in building navigation links. The question is, if I have a many-level dictionary, say 10-level, I don't