vaibhav
vaibhav

Reputation: 4096

Send image from Objective VC to Swift configured VC

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.

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

Answers (2)

Aaqib Hussain
Aaqib Hussain

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

Saumil Shah
Saumil Shah

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

Related Questions