The keyboard is only visible if some object is the firstResponder. Look at the documentation for the UIResponder class.
If your modal view controller uses the keyboard, which it sounds like it does, it takes first responder status and whatever had it on your original screen loses it. If you want to return to the same state from the modal view controller, with some object having input focus -- i.e. being the firstResponder -- with the keyboard visible you will have to have write code to make that happen. In particular, your original view controller has to know when the modal view controller terminates so that it can make your input object, textField or textView or whatever, be the first responder with the statement:
[objectIWantToBeFirstResponder becomeFirstResponder];
Now how do you know when the modal view controller is done? There are a couple obvious techniques.
If you want to use a segue then the modal view controller will have to explicitly let the presenting view controller know that it is terminating. You will probably want to define a protocol in the modal view controller and have the presenting view controller adopt it. When the modal view controller wants to exit it first tells the presenting view controller.
Since you are manually triggering the segue perhaps you're willing to present the modal view controller in code. If so then you can use a completion block:
ModalViewControllerClass *vc = [[ModalViewControllerClass alloc] init];
// whatever else you need to do to the vc
[self presentViewController:vc animated:YESorNO completion:^{
// This code gets executed when the presented view controller exits
[objectIWantToBeFirstResponder becomeFirstResponder];
}];