I have a enum
enum MenuLateralViewModel: Int, CaseIterable {
case denuncia
case autoConstatacao
case notificacao
case autoInfracao
case debitos
case profissional
case sincronizacao
}
for each item i want to return a different view, i tried doing this:
var destino: View {
switch self {
case .denuncia: return DenunciaFiltroView()
case .autoConstatacao: return View2()
case .notificacao: return View3()
case .autoInfracao: return View3()
case .debitos: return View5()
case .profissional: return View6()
case .sincronizacao: return View7()
}
}
but it gives me the error
Protocol 'View' can only be used as a generic constraint because it has Self or associated type requirements
How can i achieve this?