Instructions on third party framework dependency in building own framework - ios

I am working on an iOS framework, I need to have some guidelines on third party framework dependencies.
Suppose I need to use some open source framework(e.g.: AFNetworking) to build my own framework and my framework will be used by some partner applications who also using the same AFNetworking in their main project. Or their app is using another library/framework that is also using AFNetworking.
So my intension is to avoid integrating that AFNetworking into my framework and asked to partner to do that by their own through proper guidelines, I mean with documentation.
So what should I don in my app side as well as the process that partner app should follow. Actually to clarify the dependencies.
Any on hand tutorial will be great. Thank you :)

Related

iOS - Integrating third party library and setting dependencies

So, we need to integrate a library in our application, which is gonna be developed by another organization. This library will wrap some other, external, libs and export them to our app + an small sdk to handle a specific flow. At the end, this sdk is going to make some network calls.
The developers of the library are asking us to provide dependencies if any and how to distribute the lib.
We will agree on cocoapods, minimum sdks, and i think its wise to tell them to use the same swift version we are using as well as the same Alamofire version.
Any other suggestions?
Thanks all in advance!
If you are using cocoa pods for the integration of the plugins, the resolving of the dependencies will be managed by cocoa pods. In the .podspec file of the plugin, you can define dependencies of the plugin itself. (podspec documentation)
If you are currently developing the plugin you might hit some incompatibilities, but if you have contact to the developers of the plugin, those should be solvable.

Can a Framework Collision happen in a Swift SDK?

I am trying to develop a library, and then distribute it later as an SDK. In that library I am thinking of using a third party library.
What I am afraid of is if one of my users also include that same third party library. Would it still build? Otherwise, is there a way around this issue?
Note that I cannot use CocaoPods.
Yes, this can and will collide. You must not include a third-party library inside your library. You must have the app link both your library and your dependencies at the app layer. Tools like CocoaPods, Carthage, and SwiftPM simplify this. If you cannot use those, then you must provide instructions to your users of what libraries they must link.

How to separate iOS SDK from iOS app?

I have created one project using third party SDK.
I have done some changes in SDK and improves it more.
I want to separate out SDK in such a way that any one can use my SDK in there project.
just as same I have taken it before from somewhere else and used in my project
Is there any standard way to separate out SDK from App?
Probably you took it on a github, if not - let's anyway take github as an example.
First, when you did improves some code of third party library / sdk - i hope you still holding all the code in the same classes or at least connected classes, other way it will hard to work for that code. So, you should just take the code you improved and to contribute. Go over link it will describe you the process of how to support projects with your code.

How to manage dependencies' conflicts between a framework that I'm making and the main app?

I'm making a framework (an SDK) that will be made public. I'm thinking about a situation when it's not distributed via Cocoapods / Carthage, but rather via a simple Downloads page.
In the SDK I need to provide users an opportunity to login and share via Facebook, so I would like to use appropriate Facebook SDKs (FBSDKLoginKit / ShareKit, I assume). But if the end user of my SDK will also have these Facebook SDKs (or any other duplicate dependency), there will be a conflict.
What is the proper way to handle this situation without using Cocoapods / Carthage? I believe, one way is to avoid including / statically linking dependencies into my framework, but rather have end users download dependencies separately, but maybe there is another way around it? Making people download tons of libs from different sources isn't very convenient.
The question isn't about Facebook SDKs in particular, but about a general situation with third-party dependencies when developing a framework / library.
P.S. I found this question: Integrate Facebook SDK inside my iOS Framework. But it's specifically about Facebook, and it might be outdated (a lot of stuff happened in the iOS world since 2014).
UPDATE: the SDK will be closed source.
You could do a combination of the two ideas you suggested:
Don't include the other SDKs directly in your framework, but have them in the same project when the user downloads it. That way, if the user doesn't already have them, they can copy over all of the frameworks that they need. And if the user does already have them, then they can just copy your SDK by itself and have it just work in their project.
This combination also allows you to include tests and samples in the download. Then users end up downloading a complete, functioning project that they can try out before integrating it with their own code.

Which is the most reliable way to use a API. integrating/downloading an SDK to your application, or using the URL-HTTP-GET method

I want to know which is the best and most reliable method. i have looked on here for an answer but didn't come across any.
I Want to use multiple API'S in my project so please keep that in mind when answering. Any advice about the best way of doing this and most reliable method will really be appreciated. Thanks in advance!
Isit possible to download multiple SDK's into an iOS application through Xcode?
Pros of SDK:
Can be used offline
Most SDKs are small in file size
All of the functioning code is visible to you, the SDK developer can't keep many secrets
Cons of SDK:
Larger binary
More clutter in your Xcode project
Pros of API:
Smaller binary
Less 3rd party frameworks cluttering your Xcode project
Cons of API:
Can't be used offline
Tends to be a blackbox
App will need to be updated every time the API is updated
In terms of reliability, the SDK will always be functional assuming
It worked in the first place
It doesn't rely on an API in the background
You can integrate SDK using Cocoapods library.CocoaPods is a ruby gem that downloads all the third party libraries that you want for your project.
Getting a specific version of a pod is done by specifying the version number, and CocoaPods downloads that specific version for you saving you from searching through commits for it.
With CocoaPods, updating your dependancies is easily done with the pod update command.
CocoaPods also provides a central place where third party libraries can be found. This improves discoverability of open source libraries that you can use in your projects. You can use the search engine at cocoapods.org to search for pods.

Resources