-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pod dependencies #8
Comments
In the example app project you can add a podfile and run Some use that approach to add UI testing to the example app. |
Funnily enough, I saw your pull request there pointing to this repo, thus the question. Won't doing this break the existing (generated) workspace? I don't ask it for UI testing reasons, more because I'm creating pods that depend on other pods. |
Hmmm, I think it should work. Because the only special thing that workspace is doing is depending on the module. I haven't thought about this issue yet. Mainly because my only goal so far is to steal what AlamoFire is doing so well and distilling it into a reusable template. The problem is that I don't know any projects that are organized as beautifully as AlamoFire and also have CocoaPods dependencies so that I can steal their ideas :-) |
Allright, I did the following steps:
Seems to work. Only thing for now, using your sample project, is that the image doesn't load. The bundle it refers to is this:
Whereas the image's path is actually:
Podfile: platform :ios, '9.0'
inhibit_all_warnings!
use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'
target 'iOS Example' do
pod 'TestLib', :path => '../'
end |
Thank you, great help. This is very good progress. |
The thing is, I don't know if there should be a step in the configure script asking if you want to have pod dependencies, or just document what steps are needed for people that want it. |
Replacing let bundle = Bundle(for: type(of: self))
let image = UIImage(named: "wk", in: resources, compatibleWith: nil) with let bundle = Bundle(for: type(of: self))
let resources = Bundle(path: bundle.path(forResource: "TestLib", ofType: "bundle")!)
let image = UIImage(named: "wk", in: resources, compatibleWith: nil) fixes the image issue. I imagine this is something that's needed when the module is installed via cocoapods. No idea about SPM or Carthage, never used those. |
Thank you. In general I would like to provide extra instruction for people that would want this. Personally I think CocoaPods as a dependency manager will go out of style immediately when SPM takes off. I think of CocoaPods as a publishing outlet but I prefer not to build it in as a dependency. That's why it will be "extra work" if people want to use it for their dependency manager. People might want to use Carthage or SPM and this should be compatible with that. Sorry if all this sounds theoretical. I plan on replacing all my projects to be based off of this template so I am hoping to get it right :-) |
Fair enough. When do you think SPM will take off? Last I heard was that it's still in early stages. |
Apple states is schedule for release as part of Swift 3. Swift 4 is scheduled for Fall 2017, so I expect SPM before then. |
Closing this. |
Thanks for all the discussion here. I have added a note the the README.md referencing here. |
How would you go about creating a pod with dependencies? Currently there is no use of CocoaPods in either the module project or the example app project.
The text was updated successfully, but these errors were encountered: