Skip to content

Commit 6b4e15f

Browse files
committed
Fix circular reference compilation errors by using classes
1 parent cee7d0a commit 6b4e15f

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

Keyboards/DataManager/DataContract.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct DeclensionSection: Codable {
3838
let declensionForms: [Int: DeclensionNode]?
3939
}
4040

41-
struct DeclensionNode: Codable {
41+
class DeclensionNode: Codable {
4242
let label: String?
4343
let value: String?
4444
let displayValue: String?

Keyboards/KeyboardsBase/NavigationStructure.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@
66
import Foundation
77

88
/// Represents a single option in the navigation.
9-
enum NavigationNode {
9+
indirect enum NavigationNode {
1010
case nextLevel(NavigationLevel, displayValue: String?) // navigate deeper, with optional display value
1111
case finalValue(String) // terminal node, insert this text
1212
}
1313

1414
/// Represents a level in the navigation hierarchy.
15-
struct NavigationLevel {
15+
class NavigationLevel {
1616
let title: String // title for command bar
1717
let options: [(label: String, node: NavigationNode)] // buttons to display
18+
19+
init(title: String, options: [(label: String, node: NavigationNode)]) {
20+
self.title = title
21+
self.options = options
22+
}
1823
}
1924

2025
/// Builds navigation trees for conjugations and declensions.

0 commit comments

Comments
 (0)