1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
enum AppRoute: Hashable {
case post(String)
case profile(String)
case profileConnections(String, ProfileConnectionKind)
case compose(replyTo: String? = nil, quotePostID: String? = nil)
}
extension AppRoute {
init(detail: PadColumn.Detail) {
switch detail {
case .post(let id): self = .post(id)
case .profile(let id): self = .profile(id)
case .profileConnections(let id, let kind): self = .profileConnections(id, kind)
}
}
var padDetail: PadColumn.Detail? {
switch self {
case .post(let id): return .post(id)
case .profile(let id): return .profile(id)
case .profileConnections(let id, let kind): return .profileConnections(id, kind)
case .compose: return nil
}
}
}