I have an Xcode 11 iOS project where I have created a local Swift Package for some basic services.
I have also added CocoaPod support where I am using a CocoaPod (SwiftEntryKit) for some UI stuff in the main project (not the Swift Package) which works fine.
Now I would like to reference a new CocoaPod (SwifterSwift) from within the local Swift Package itself. Is this possible? It does not have access to the SwiftEntryKit Pod I am already using in the main project - if I import it, it does not know the modules.
If you cannot reference Cocoapods from a Swift Package it makes the package rather limiting.
Thanks.
Related
For example, when I use Alamofire, I can import it as a cocoapod or as a swift package. If I did both and include "import Alamofire", I found that it prefers to use the swift package module and not the pod module. This happens regardless of what version of Alamofire I've imported from both cocoapods or swift packages.
Is there a way to tell Xcode in the import statement to prefer a particular version of the module? Version as in release version, or some way to distinguish the package manager/pod vs swift package?
The use case for this is if multiple modules and dependencies are switching to swift package manager, and some dependencies make that switch at different times, or include overlapping dependencies with the main application.
I have an iOS project, that is divided into various frameworks using Swift packages. Now I need to create another swift package, which would include:
Some dependencies from other swift packages
Other dependencies from CocoaPods (GoogleMLKit/ObjectDetectionCustom to be exact)
How can I do this? Is there some way to import cocoa pod into the swift package?
For now, I implemented all this new functionality inside the main iOS app project, but I really don't like this solution. I would love to have this in a separate package.
You could perhaps include the GoogleMLKit/ObjectDetectionCustom package (if there is one) inside the package you are importing into your main project
For example I use Reachability package inside my own package which I then include in my main project
I'm trying to use Wordpress-iOS-Editor (written in obj-c) in my SWIFT project. I've managed to install the Wordpress-iOS-Editor Pods and I made a bridge file to connect it with swift project and now I can call any method or function from the Pods in my swift project.
The problem is HOW TO IMPLEMENT the editor in my swift project with the use of Wordpress-iOS-Editor Pods (library) that I already added. (I don't know which methods and how should I use them.)
In Podfile:
use_frameworks!
In source:
import WordPressEditor
I'm trying to use PayMill SDK in a Swift project.
I used CocoaPods as described by PayMill, the framework, and it generated 'Pods_PayMilDSK'
After that I tried to import it on my file but I can't get access to any to the functions included in the framework.
I also tried to import the framework directly in my project but I can't access the PayMillSDK framework (i.e. import does not 'see' it).
Any help would be greatly appreciated.
Rodolphe
After running pod install You should always Build your project, cmd + B, because your project still hasn't read the contents of the library you just installed.
Also make sure you're using the .xcworkspace and not the .xcodeproj
I can now make the import of the PAyMill module but functions are not available
I have been trying to create a git repo with my framework and trying to distribute it using pods. I have written a podspec which downloads all the dependencies as well as my framework. The pod functions properly. I even imported the framework to the appDelegate of the sample project to test its functionality.
Now when I am using a class of that framework I am getting the following error
'MyClass' is unavailable: cannot find Swift declaration for this class
I have tried to build the project for both simulator and iPhone, but the result being the same.
Does anyone has insight on this one?