---
title: "Comment by Ana on \"Clean, Simple and Composable Routing in Swift for iOS Apps - Part 1\" | Hashnode"
description: "Hi Cassius! This is an amazing approach, thank you very much for sharing it. I&#39;m having a problem that I hope you can help me to solve. I&#39;m trying to ch"
url: "https://hashnode.com/posts/clean-simple-and-composable-routing-for-ios-apps/5e6c2365bc8844135ba495b1/comment/60991b3a21068818a5c63f7b"
---

[Discussion](https://hashnode.com/posts/clean-simple-and-composable-routing-for-ios-apps/5e6c2365bc8844135ba495b1)

Comment [Clean, Simple and Composable Routing in Swift for iOS Apps - Part 1](https://hashnode.com/posts/clean-simple-and-composable-routing-for-ios-apps/5e6c2365bc8844135ba495b1)

[Ana](https://hashnode.com/@anitai26)

[May 10, 2021](https://hashnode.com/posts/clean-simple-and-composable-routing-for-ios-apps/5e6c2365bc8844135ba495b1/comment/60991b3a21068818a5c63f7b)

Hi Cassius! This is an amazing approach, thank you very much for sharing it.

I'm having a problem that I hope you can help me to solve. I'm trying to change programmatically the tab, I was able to do it from my router like this:

```
func changeTo(tab: Tabs, _ completion: (() -> Void)?) {
     if root?.tabBarController?.selectedIndex != tab.rawValue {
           root?.tabBarController?.selectedIndex = tab.rawValue
     }

     completion?()
}
```

But when I do that, the router system doesn't recognise that the tab have been changed so the main router isn't the new visible view.

Do you have any ideas of how to solve this? Thanks in advance!
