-
Notifications
You must be signed in to change notification settings - Fork 2.3k
How to use cocoalumberjack with Swift #405
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
Comments
I think that for now you should install the standard Objective-C library with CocoaPods and then manually import the I will just make sure that the wrapper is preserved in the directory as currently it gets deleted by CocoaPods. |
Also there is #400. |
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). Do I need to add on something ? Tweak the bridging header file ? |
@crazykoala May be this will help - http://swiftwala.com/cocoapods-is-ready-for-swift/ |
I have followed the procedure indicated, and it's working for alamofire and swiftjson. Not working for cocoalumberjack though. 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 ? |
@crazykoala Give this a try:
|
Ok this retrieves the pod with the .swift wrapper. But still it doesn't compile afterwards.
Really no luck :/ |
@palewar Maybe also include the |
@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) |
Yes. You just set the official repository in the |
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 ? |
Closing this in favor of #383. |
@crazykoala Probably a silly question, but are you using |
I will try to set up a proper Swift Demo project. |
@palewar yes , sure I am using the workspace. @rivera-ernesto , a demo with the cocoalumberjack as pod dependency. I'd be very curious to see how it's set up, cause mine fails no matter what i try, Thx |
Gonna make one tomorrow. |
What was the outcome here guys? I am having the same issue. |
Yup, got the same question. I know this ticket is closed, but I got the same "No such module" error. |
CocoaPods is very close to releasing Swift support. Does anyone wants to give a try to the betas? Sadly I didn't get the time to work on it. Let's reopen this in the mean time. |
@thejeraldo thanks, your comments help me a lot:-) |
Somebody can make a summary on how to use Cocoalumberjack with SWIFT 2.0 ? |
I created a test project here> https://github.com/johndpope/CocoaLumberjack-Swift pod 'CocoaLumberjack/Swift', :git => 'https://github.com/CocoaLumberjack/CocoaLumberjack.git', :branch => 'swift_2.0' I had troubles with the original Formatter class in this repo - so feel free to grab my one.
|
Thanks a lot John ! This was be very helpfull ! This little exemple save my night ! |
@johndpope thanks! extremely helpful! |
I installed PubNub which has dependency of CocoaLumberjack using CocoaPods. It installed fine and CocoaLumberjack.swift is created without trouble. |
@bpoplauschi Is still an issue in master branch? it would be great help if we get out of this workaround? |
I'm not sure. You should try for yourself :) |
I've been building an objective-c to swift converter. |
Thanks @johndpope is it beta? and will it work as original Lumberjack(Objective-c) version? |
It's early beta - but stable. Fire up the app - point it to an existing repository. It will trawl through .m source files en masse and translate to .swift files. Defect list is growing - but I have been collecting them. |
this is a sample repo - from a few weeks back. |
Thanks a lot i will play with this in sometime |
Just run the demo project. i get compile error. any idea? :0: error: could not build Objective-C module 'CocoaLumberjack' |
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. |
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. |
@bpoplauschi Is there any documentation around swift support yet? such as setup and usage? |
I think that would have to come from contributors through pull requests ;) |
@bpoplauschi @rivera-ernesto with swift 2.0 support in master, do we still have to manually import the swift wrapper file ( |
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. |
I think we still need to write the documentation part. Anyone can help with that? |
Closing this with the following answer (Cocoapods):
|
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
The text was updated successfully, but these errors were encountered: