Closed
Description
Hi.
I've been reading here and there, and I am unsure how to use the framework with swift.
I've seen people aking their own wrappers in swift, but that was quite some months ago.
Following the issues in there, my understanding is that there's an official swift wrapper for using cocoalumberjack.
Having retrieved the lib with cocoapods , the beta 4 from 2.0.0, I still don't see any swift class there, and none of the example projects uses a swift also.
So I'm kinda confused how to make that work with the "official" means.
Any light that you can shed on this ?
Thx
Metadata
Metadata
Assignees
Type
Projects
Relationships
Development
No branches or pull requests
Activity
rivera-ernesto commentedon Nov 27, 2014
I think that for now you should install the standard Objective-C library with CocoaPods and then manually import the
CocoaLumberjack.swift
wrapper, as CocoaPods doesn't yet support Swift.I will just make sure that the wrapper is preserved in the directory as currently it gets deleted by CocoaPods.
rivera-ernesto commentedon Nov 27, 2014
Also there is #400.
GuyFran commentedon Nov 27, 2014
I have added , as usual, the lib pod to my podfile. It's there.
Now I've manually imported the CocoaLumberjack.swift to my project (in swift).
But I get a compile error : import CocoaLumberjack -> "No such module"
Do I need to add on something ? Tweak the bridging header file ?
palewar commentedon Nov 27, 2014
@crazykoala May be this will help - http://swiftwala.com/cocoapods-is-ready-for-swift/
GuyFran commentedon Nov 28, 2014
I have followed the procedure indicated, and it's working for alamofire and swiftjson.
Not working for cocoalumberjack though.
I tried to paste
pod 'CocoaLumberjack', :git => "https://github.com/CocoaLumberjack/CocoaLumberjack.git", :branch => "podspec"
in my Podfile. No success. What would be the proper line for the podfile for this library ?
palewar commentedon Nov 28, 2014
@crazykoala Give this a try:
pod 'CocoaLumberjack', :git => "https://github.com/ValCapri/CocoaLumberjack.git"
GuyFran commentedon Nov 28, 2014
Ok this retrieves the pod with the .swift wrapper.
But still it doesn't compile afterwards.
Really no luck :/
rivera-ernesto commentedon Nov 28, 2014
@palewar Maybe also include the
:commit
.GuyFran commentedon Nov 28, 2014
@rivera-ernesto , is there such a way with the "official" repo ?
Or is there a step by step guide on how to include the lib with a swift project ? (with or without cocoapods)
rivera-ernesto commentedon Nov 28, 2014
Yes. You just set the official repository in the
:git
part.GuyFran commentedon Dec 1, 2014
I see , but I'm actually trying to get it working with Swift.
@palewar , when I use this branch, I get the swift class, but I get an error upon compile : " No such module CocoaLumberjack" on the import line.
Could you help me fix this ?
rivera-ernesto commentedon Dec 1, 2014
Closing this in favor of #383.
palewar commentedon Dec 1, 2014
@crazykoala Probably a silly question, but are you using
.xcworkspace
file to open and build project? Please share yourPodfile
with me or your github URL if it's a public project and I will see if I can do anything to get it working.52 remaining items
bpoplauschi commentedon Oct 12, 2015
I just tested with the https://github.com/johndpope/CocoaLumberjack-Swift project and after a few updates, everything worked fine. I have created a PR with the updates. I think our current Swift branch looks good and can be merged into master.
bpoplauschi commentedon Oct 12, 2015
I have just released a Beta 2.1.0 version via CocoaPods including the Swift 2.0 support (also available in the latest master). Please test it and tell us if it works as expected.
jpshelley commentedon Oct 12, 2015
@bpoplauschi Is there any documentation around swift support yet? such as setup and usage?
rivera-ernesto commentedon Oct 12, 2015
I think that would have to come from contributors through pull requests ;)
jpshelley commentedon Oct 12, 2015
@bpoplauschi @rivera-ernesto with swift 2.0 support in master, do we still have to manually import the swift wrapper file (
CocoaLumberjack.swift
)?johndpope commentedon Oct 12, 2015
Thx @bpoplauschi I've merged that request.
fyi - it's possible to use bundler to manage dependencies around which cocoapods version a project should use. As swift has been in a state of flux / one week project may work - the next - broken.
I don't have time to add to project - but I highly recommend this if you're working in teams with different cocoapod / xcode versions.
http://www.sm-cloud.com/rvm-bundler-cocoapods-happy-dependency-management/
bpoplauschi commentedon Oct 21, 2015
I think we still need to write the documentation part. Anyone can help with that?
rivera-ernesto commentedon Oct 21, 2015
Closing this with the following answer (Cocoapods):
pod 'CocoaLumberjack/Swift', :tag => '2.1.0-beta'