I have a Facebook login screen based on Objective-C code and xib file for interface. After generating the access token, I want to open the next screen that is based on Swift. Anyone please help me how do I open a swift based view controller from objective-c view controller. When I write the name of view controller, xcode never recognizes. Googled since yesterday but got no success. Please help :)
Asked
Active
Viewed 871 times
3
-
2Have you configured your project to detect swift files? If not, then please check this: http://stackoverflow.com/questions/24002369/how-to-call-objective-c-code-from-swift also this http://mobiforge.com/design-development/using-objective-c-and-swift-together-ios-apps – Sohil R. Memon Apr 30 '15 at 07:44
-
@SohilR.Memon: thanks a lot, now xcode is able to recognise my swift file after importing
, but still I can switch to that view controller: the code is not doing anything. here is the code im using to switch to that view controller: 'ViewController *directionViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"viewController"]; [self.navigationController pushViewController:directionViewController animated:TRUE];' – Saraz Apr 30 '15 at 08:09 -
1have you imported your swift file in bridgingheader.h file? – Sohil R. Memon Apr 30 '15 at 08:53
-
1the one I want to open? How do I import it? #import "ViewController.swift"? – Saraz Apr 30 '15 at 10:55
-
its creating error in ViewController class – Saraz Apr 30 '15 at 10:58