I have actually done this a lot at my office. We have tons of private source code that is re-used quite a bit. CocoaPods has helped get new projects started much quicker and makes them a whole lot easier to update.
While it is possible to add your framework to the podspec, I have found it much easier to just pass the static library and headers over via CocoaPods rather than worry about the framework.
You will have to update your podspec based on your project, but here are the important parts:
s.source_files = 'StaticLib/Headers/*.h'
s.preserve_paths = 'StaticLib/libYourLibrary.a'
s.library = 'YourLibrary'
s.xcconfig = { 'LIBRARY_SEARCH_PATHS' => '$(PODS_ROOT)/ProjectFolder/LibraryFolder' }
s.dependency = 'AFNetworking'
This will copy your static library over as well as bring over AFNetworking with your pod too. This will make your static lib much smaller (not having to build it in) and speed up how quickly the user can import your pod.
If you must use framework, the same stuff from above still applies, but you might have some slight tweaking to do. All a framework is is a pretty folder structure for a static lib and headers anyway, so why bother with the extra stuff. The source is all still built into the lPods.a static lib anyway. Hope this helps you out.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…