As a sidenote, it's not advisable to make one of these view builders that swaps views out under the hood like this. This causes the view to get removed from the hierarchy and a new one put in its place whenever the condition changes, rather than just changing the accent color.