0

in my objective-c view controller i need push to next swift view controller, my basic project - obj c, after add swift file, Xcode generate Bridging-Header.h, but i not see -swift.h file

hot to push in swift View from obj-c view ?

-(void)longTapInDaClub:(UILongPressGestureRecognizer *)longTap {

  UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"mail" bundle:nil];
nextView *view = (nextView *) [stb instantiateViewControllerWithIdentifier:"next"];
[nextView getIdSample: _idSample];
[self.navigationController pushViewController:view animated:YES];
} 

nextView - is Swift view controller

2 Answers 2

1

i solved problem - in project settings -> build settings -> product module name -> and enter valid name with no special chars and digital char - rebuild project and #import "moduleName-swift.h"

Sign up to request clarification or add additional context in comments.

Comments

0

It is exactly the same - you are using the storyboard to define the transitions and your push to segue will be connected up to the swift view controller. So as long as the 'next' is pointing to the right place it doesn't matter if it's swift or not.

3 Comments

no, i need long press button action and use getter in swift view :(
run it in a debugger and find out whether your nextView is nil or not, and if so, check you have a named segue from your current one to the next one.
sorry, i not understand - how to seque with long press ?))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.