Reputation: 4096
I am working on a project which somewhere needs to send the edited image to another ViewControler
using segue or storyboard.
Some points to understand first.
ViewController
i am sending image which is configured using Objective C
.ViewController
which is configured using Swift
Lang.Problem:
The Swift Class which is imported in Objective .m file is not visible so it lets me to create its object to make reference of its members.
I tried:
// here i am not able to create SwiftVC class object so i can pass image further
SwfitVC *object = [self.storyboard instantiateViewControllerWithIdentifier:@"VC_Identifire"];
object.image = image;
[self.navigationController pushViewController:object animated:YES];
SwftVC Class is not visible after importing to .m file.
Please have look. Thanks.
Upvotes: 0
Views: 93
Reputation: 838
In order to make your Swift file visible; in your .m file you'll have to write this import statement.
#import "YourProjectName-Swift.h"
Clean and build then you'll be able to use your Swift class.
Upvotes: 7
Reputation: 2349
Alternate way:
You can save the image to Document Directory in Objective-c class and fetch it into Swift Class.
Might be a help this logic.
Upvotes: 0