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 } } }