Comments (12)
In the example app project you can add a podfile and run pod install
as usual.
That approach is used in this project CocoaPods/pod-template#187
Some use that approach to add UI testing to the example app.
from swift5-module-template.
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.
from swift5-module-template.
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 :-)
from swift5-module-template.
Allright, I did the following steps:
- Deleted existing workspace
- Removed "link with" old framework
- Added Podfile in example directory
- pod install
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:
.../iOS Example.app/Frameworks/TestLib.framework
Whereas the image's path is actually:
.../iOS Example.app/Frameworks/TestLib.framework/TestLib.bundle/wk.png
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
from swift5-module-template.
Thank you, great help. This is very good progress.
from swift5-module-template.
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.
from swift5-module-template.
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.
from swift5-module-template.
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 :-)
from swift5-module-template.
Fair enough.
When do you think SPM will take off? Last I heard was that it's still in early stages.
from swift5-module-template.
Apple states is schedule for release as part of Swift 3.
Swift 4 is scheduled for Fall 2017, so I expect SPM before then.
from swift5-module-template.
Closing this.
from swift5-module-template.
Thanks for all the discussion here. I have added a note the the README.md referencing here.
from swift5-module-template.
Related Issues (20)
- Xcode 8.2.1 released, update recipe
- .travis.yml file has some issues. Also an issue with the location of info.plist for the test target. HOT 2
- __PROJECT_NAME__ not replaced in .gitignore HOT 1
- --PROJECT-NAME-- not substituted in PRODUCT_BUNDLE_IDENTIFIER
- Proj/Proj.xcodeproj/project.pbxproj has lines still with the term Proj.--PRODUCT-NAME--
- Improvements for pod dependencies [DISCUSSION, HELP REQUESTED] HOT 7
- Adding ObjC file to template HOT 4
- Crash when using Swift standard libraries HOT 2
- Rename to swift4-module-template HOT 2
- Update for Swift 4
- Upgrade to support Swift 5 HOT 1
- Update ./configure for new variables
- Update Package.swift to use Swift 5+ HOT 3
- Update for Xcode Version 12.3 (12C33)
- No such Module $ModuleName in ContentView.swift (Xcode 12.4) HOT 3
- Unable to Drag and drop 'xxProjectxNamexx' in to iOS Example. HOT 2
- Move from Travis CI to GitHub Actions HOT 2
- Update recipe images HOT 3
- Support for Non-ASCII characters HOT 1
- Update for Xcode Version 14.1 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swift5-module-template.