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.
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
}
}