Quantcast
Channel: Active questions tagged cocoapods - Stack Overflow
Viewing all articles
Browse latest Browse all 1028

cannot access swift class from objective-c pods

$
0
0

I have created a new single-view swift project, and then added a pod file (for MWPhotobrowser) and installed it. I can now do import MWPhotobrowser on top of ViewController.swift file and use this framework without problems.
but I need to make some changes to this pod by adding extra properties to MWPhotoBrowser.h file, one of these properties is a reference to ViewController.swift class.

I am aware of the following:
A) It's not a good practice to make changes on pod frameworks since pod update will overwrite these changes.
B) I can fork the main github repo and point cocoa pods to my fork.
C) I can download the frameworks form github and do not use cocoa pods at all.
But for my specific case, I need to access ViewController class from inside cocoa pods ?

things I've already tried:
1)Defines Modules set to yes in the main project as well as in the pods project
2)#import "ProjectName-Swift.h" gives file not found
3) dragged the file ViewController.swift into Pods project (the blue icon in project navigator), this gave me: Include of non-modular header inside framework module 'MWPhotoBrowser.MWPhotoBrowserPrivate' build error, which I've tried all possible solutions on SO to solve this error but to no avail ...
4) marked ViewController class with @objc attribute

and here is a clean sample project.
how can I access ViewController swift-based class from inside pods ?


Viewing all articles
Browse latest Browse all 1028

Latest Images

Trending Articles



Latest Images