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.
Related
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.
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 :)
I am developing an app for IOS,and I have to use some framework.
as you know Cocoa pods and Carthage are dependancy manager for iOS and mac OS
my question is "why we have to use dependancy manager?, instead of using dependancy manager just clone that project[was written by other programmer and can be used as framework] and drag and drop to your project ??"
Thanks for your answers
Few things that you need to think about is:
Updating your dependencies when new versions came out.
Updating dependencies for multiple platforms.
Interdependent frameworks and different framework versions for dependant frameworks.
Basically, time that you will spend on maintaining dependancies for your project will grow as your project grows. Dependancy managers allow you to avoid all this unnecessary and boring work.
There are a lot of other reasons to use DM instead of just importing frameworks. More about you can find here. And here.
At some point you might want to use 3rd party code to get extra features or something, you can copy the source code but how you will update it in the future? keep coping it again!!
Also some of your 3rd party code might depend on other 3rd part code, and if you copied it twice, you will get duplicate symbols.
Dependency managers handle all this for you.
My advice is to use Carthage or submodules, but do not use CocoPods, anything that touches the project file is not a good practice with Apple.
Why Libraries are Your Friend
While you aren’t strictly required to use third-party libraries or
frameworks, they can definitely save you a lot of time and let you
focus on polishing your app instead of typing out countless lines of
code that you simply don’t need to write.
You can use third-party frameworks and libraries without a dependency
manager too, and you can get hands-on tutorials about them right here
on this site. For example, there’s our Alamofire tutorial, and our
SwiftyJSON tutorial.
Without a dependency manager, you simply add each library’s code to
your project manually. However, this approach has several
disadvantages:
Updating a library to a new version can be difficult, especially if several libraries must be updated together because one depends on
another.
Including a library in your project makes it tempting to make local changes to the code, making it harder to update to a newer version
later.
Determining the current versions of libraries used in your app can be hard to do, especially if you don’t proactively keep track of them.
Finding new libraries can be difficult without a central location to see all the available libraries.
CocoaPods helps you overcome all of these issues and more. It fetches library code, resolves dependencies between libraries, helps
you search for and discover new libraries, and even sets up the right
environment to build your project with minimum hassle.
Courtesy
https://www.raywenderlich.com/97014/use-cocoapods-with-swift
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.
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.