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
Adopt Overcoat to work with Mantle 2.0 #87
Conversation
This commit makes Overcoat work with both Mantle 1.x and Mantle 2.x Following are changes: - Add `OVERCOAT_USING_MANTLE_2` in `OVCUtilities.h` as macro used to separate codebase for different Mantle versions. - Separate `CoreData` support and `Social` framework support * In Mantle 2.0, CoreData support is not provided by default, it comes another submodule. (`MTLManagedObjectAdapter`) * Since `Social.framework` support is not a required module of Overcoat, it should be a submodule. * This is a backward incompatible change. > To use CoreData, even if you are using Mantle 1.x, you should use `pod 'Overcoat/CoreData'` > To use Social.framework, even if you are using Mantle 1.x, you should use `pod 'Overcoat/Social'` - Refine Xcode project used to run tests. * Integrate `Overcoat` with test targets by **cocoapods**. (Overcoat was integrated with test targets by Xcode's settings originally, but we should test for cocoapods) * You can use `make test` to run tests targeting on both iOS/OS X and Mantle 1.x/2.x * And since `Social` and `CoreData` have been separate as submodules, their tests are also separated. * Update `OHHTTPStubs` to 4.x * The `Podfile` attached is used to run tests. You could pass environment variables to decide what to install (for tests). For example, `OS_TYPE=OSX MANTLE=2.0 pod install` will setup cocoapods to install packages required for testing on OS X with Mantle 2.0
@gonzalezreal any idea for this? |
I'm hoping this is merged soon |
@ryanmaxwell Great 👍 if you want test with it now, you could use My app is using it (on the App Store) and things seems to be okay :) |
@sodastsai Thanks a lot for the contribution! I will look into it soon. |
@sodastsai Nice. Could you also upgrade PromiseKit to 2.0.6? |
@lexrus I am not familiar with and don't use PromiseKit, so I could not help you. If possible, you could also create a new PR for this. |
@sodastsai Thanks again for the contribution. First of all, sorry for taking so long to look into this. I added you as a collaborator so I don't stall your contributions. I had a chance to have a look at it and everything looks fine. Did you get any feedback from other users about this PR? |
@gonzalezreal I've merged back to the master branch. and so let's prepare to update the pod. if possible, could you please add me as one of authors? Then after a period to wait for more feedback, I'll update the pod, Thanks. (Via |
@sodastsai does your project use MTLManagedObjectAdapter? I'm having issues building the project. I've added the following to my podfile:
But I'm getting linker errors on compilation:
|
Hmmm .... My project doesn't use CoreData. But I've tried with
Could you try the example in the |
thanks for quick response. I can build and run the core data tests. Not sure why my project isn't building. I'll keep investigating. I suspect it may be a cocoapods integration issue. I'm trying to include it now with the subspec 'Overcoat/CoreData' but having the same linker issue. I'll update here if I figure it out |
@sodastsai I've created PR which fixed my integration #91 |
okay, I see. I guess you have I've reproduced your issue now. As you said, it's related to how Cocoapods generate module map for Swift. I would fix this later. 👍 |
yep I'm using frameworks as i've got a shared swift/obj-c project and I can |
So, I realize one thing that original design in this commit is not only breaks Swift integration, but also bad. Yup, the interface of classes maybe changed by other external configurations. I mean, if someone just installs just Thus I re-organize the whole interface, take By doing so, it also solves your issues. Would you like to try and test for the master branch? (But there's a break change. You have to change class names.) Btw, you could start test by following Podfile lines # Work with Mantle 2.x
pod 'Overcoat/CoreData', :git => 'https://github.com/Overcoat/Overcoat.git', :branch => 'master'
# Work with Mantle 1.x
pod 'Overcoat/CoreData/Mantle1', :git => 'https://github.com/Overcoat/Overcoat.git', :branch => 'master' (you don't have to specify Thx. |
@sodastsai fantastic dude, pod installed master, compiled and ran no problem. Good job. (Mantle 2.x) My only question - the interface changed from |
which class? I cannot find this. |
The designated initializer for |
So if you want to use CoreData support with
|
ah right. I forgot there is 2 AFNetworking class hierarchies for with and without NSURLSession. Thanks for the clarification |
👍 |
@gonzalezreal I think this PR is ready (though it has been merged back already). Could you add me as a author of the cocoapods podspec? Thanks in advance. |
@sodastsai No problem, but I need an email address to do that |
@sodastsai Got the email, thanks. You need to register with that email using |
👍 already done
|
Done. There was a typo in the email on the first comment. |
👍 |
Following are changes:
OVERCOAT_USING_MANTLE_2
inOVCUtilities.h
as macro used to separate codebase for different Mantle versions.CoreData
support andSocial
framework supportMTLManagedObjectAdapter
)Social.framework
support is not a required module of Overcoat, it should be a submodule.Overcoat
with test targets by cocoapods. (Overcoat was integrated with test targets by Xcode's settings originally, but we should test for cocoapods)make test
to run tests targeting on both iOS/OS X and Mantle 1.x/2.xSocial
andCoreData
have been separate as submodules, their tests are also separated.OHHTTPStubs
to 4.xPodfile
attached is used to run tests. You could pass environment variables to decide what to install (for tests). For example,OS_TYPE=OSX MANTLE=2.0 pod install
will setup cocoapods to install packages required for testing on OS X with Mantle 2.0