# Back button doesn't work/missing on multiple pages of the UIKit

**URL:** <https://forum.social.plus/t/back-button-doesnt-work-missing-on-multiple-pages-of-the-uikit/56>\
**Category:** iOS\
**Tags:** technical\
**Created:** [April 12, 2021, 4:17am UTC](https://forum.social.plus/t/back-button-doesnt-work-missing-on-multiple-pages-of-the-uikit/56 "2021-04-12T04:17:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sarah](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@Sarah](https://forum.social.plus/u/Sarah)\
**Post date:** [April 12, 2021, 4:17am UTC](https://forum.social.plus/t/back-button-doesnt-work-missing-on-multiple-pages-of-the-uikit/56/1 "2021-04-12T04:17:37Z")

</div>

For context, I have made a custom controller and pass in the view controller from the UIKit as child controllers.

The back button is not to be seen anywhere on multiple pages of the view controller, is there a way to bring that functionality back?  
Example:  
[![8f66186d0601](https://europe1.discourse-cdn.com/flex013/uploads/amity/original/1X/7e95424f48371394b701719a2a11261e034b5858.jpeg)](https://user-images.githubusercontent.com/74768384/103504462-0c13a700-4e8a-11eb-9e9e-b43756c3b097.jpeg)  
[![409f4694e695](https://europe1.discourse-cdn.com/flex013/uploads/amity/original/1X/6ca7159895886fe170b7dc3afe205674d50952ef.jpeg)](https://user-images.githubusercontent.com/74768384/103504464-0d44d400-4e8a-11eb-826d-770f5bc84427.jpeg)  
[![547a74bd1d60](https://europe1.discourse-cdn.com/flex013/uploads/amity/original/1X/d497a5f1b719e70239260cdf9134603fabb81420.jpeg)](https://user-images.githubusercontent.com/74768384/103504470-0fa72e00-4e8a-11eb-85e9-a9d3593a2d1d.jpeg)

**In addition, the back button here is presented but the functionality of it doesn’t work. Can you please advise?**  
[![6dc835605956](https://europe1.discourse-cdn.com/flex013/uploads/amity/original/1X/0cb1e15936538ae09e4a46160c6a066e343b64f0.jpeg)](https://user-images.githubusercontent.com/74768384/103504509-38c7be80-4e8a-11eb-9230-6858554e36f9.jpeg)

Thank you!

---

<div class="post-metadata">

**Author:** ![Sarah](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@Sarah](https://forum.social.plus/u/Sarah)\
**Post date:** [April 12, 2021, 5:06am UTC](https://forum.social.plus/t/back-button-doesnt-work-missing-on-multiple-pages-of-the-uikit/56/2 "2021-04-12T05:06:05Z")

</div>

Additional information on what might cause the issue after some investigation for the back button issue on creating a new post screen.

On tap of a new post, SDK is presenting the screen and on the next screen, since the navigation bar is being used, it tries to pop a controller on the back button pressed which is not working.  
1- you have to push the screen for a new post  
2- get custom action and dismiss controller instead of pop.

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [April 12, 2021, 5:07am UTC](https://forum.social.plus/t/back-button-doesnt-work-missing-on-multiple-pages-of-the-uikit/56/3 "2021-04-12T05:07:51Z")

</div>

View controllers in Upstra SDK are subclassing from EkoViewController. Each contains `EkoNavigationBarType` , enums to determine navigation type.  
The navigation bar type requires UINavigationController to make it works. See the example below.

**1. Presenting**  
If you want to present Upstra view contorllers, please create navigation controller once before presenting.

```
class YourHomeViewController: UIViewController {
    func presentPostTarget() {
        let vc = EkoPostTargetSelectionViewController.make()
        let navigationController = UINavigationController(rootViewController: vc)
        present(nvc, animated: true, completion: nil)
    }
}

```

**2. Pushing**  
If you don’t have UINavigationController in your view hierarchy yet, create it once.

```
class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        let home = YourHomeViewController()
        UIApplication.shared.windows.first?.rootViewController = UINavigationController(rootViewController: home)
        UIApplication.shared.windows.first?.makeKeyAndVisible()
        
        return true
    }
}

```

In case you already have a navigation controller, just push it simply and please ensure `viewController.hidesBottomBarWhenPushed` is false.

```
class YourHomeViewController: UIViewController {
    func pushPostTarget() {
       let vc = EkoPostTargetSelectionViewController.make()
        navigationController?.pushViewController(vc, animated: true) // please check if navigationController is not nil
    }
}
```
