Turn List UI

Display a list of turns for the navigation route.

Before you can do this, you need a TGRoute . Here's how to get one.

func showTurnList(route: TGRoute) {
    let viewController = TGTurnListViewController.create()
    viewController.segment = route.segments.first

    if let navigationController = navigationController {
        navigationController.navigationBar.isHidden = false
        navigationController.pushViewController(viewController, animated: true)

    } else {
        viewController.navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(pressDoneButton(_:)))
        present(viewController.embedInNavigationController(), animated: true, completion: nil)
    }
}

// This method isn't necessary if you're pushing it onto a UINavigationController
@objc func pressDoneButton(_ sender: UIBarButtonItem) {
    dismiss(animated: true, completion: nil)
}
- (void)showTurnList:(TGRoute *)route {
    TGTurnListViewController *viewController = [TGTurnListViewController create];
    viewController.segment = route.segments.firstObject;

    if (self.navigationController != nil) {
        self.navigationController.navigationBar.hidden = NO;
        [self.navigationController pushViewController:viewController animated:YES];

    } else {
        viewController.navigationItem.leftBarButtonItem = [UIBarButtonItem.alloc initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(pressDoneButton:)];
        [self presentViewController:[viewController embedInNavigationController] animated:YES completion:nil];
    }
}

// This method isn't necessary if you're pushing it onto a UINavigationController
- (void)pressDoneButton:(UIBarButtonItem *)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}
Expected Output
TallyGo
Check out the iOS Reference App to see this example in action.

Look for example 207 in the app.