Search code examples
iosobjective-czendesk

iOS SDK : Push Issue Creation rather than present 'modally'


Using the Zendesk SDK for iOS an issue creation view controller can be presented as follows:

    [ZDKRequests showRequestCreationWithNavController:self.navigationController];

What is the easiest / highest level of abstraction for pushing the same view controller, rather than presenting it 'modally' ?


Solution

  • The ZDKCreateRequestViewController is not designed to be pushed but you can push it by calling

    ZDKCreateRequestViewController *viewController = [[ZDKCreateRequestViewController alloc] init];
    [self.navigationController pushViewController:viewController animated:YES];
    

    But you will need to remove the the left navBarButton as it won't work because it is trying to dismiss modally. You can do this by setting viewController.navigationItem.leftBarButtonItem = nil before you push and this will then allow the view controller to generate a navBarButton that will pop the view controller.