Closed hxperl closed 2 years ago
Hi, thanks for the pull request.
Unfortunately this is a very user specific usecase of SwitchRoutes
and therefore has no place in the package itself. It also forces a GeometryReader
around the content of the Route
. SwiftUI Router tries to make as little decisions for the developers as possible when it comes to layout et al.
Also, if you dislike the multitude use of brackets, Route
s have an initializer with @autoclosure
😉
Route("news", content: NewsView())
Route("settings", content: SettingsView())
Whenever I write View code that uses SwitchRoutes, it use a lot of brackets
{ }
, which makes the code hard to read. For example when writingMainView
, actual View code placed GeometryReader -> SwitchRoutes -> Routeso that I added extension functions