Different apps from the same code base - ios

I have developed a generic app, which can ne customized for clients. Each app should be available in the app store.
Any idea what is the best way to deploy the different apps? This is of course also necessary on app updates.
Only the package name, some graphics and some settings change for different Apps. The Code will be the same for all.

Consider deploying your app as a framework, static library or CocoaPod. The clients should be able to use your framework/pod to customize the appearance (and anything else) and publish their apps.
CocoaPods: If your project is in progress and your client is using it, I wouldn't recommend it. Pods are great way for managing dependencies mostly if dependencies are not going to change on nightly basis. Also you'll have to make a few decisions about how to integrate it with your source control. If you and your clients will be working on their client app and pods simultanously. They'll most likely have to get your pods in a workspace, which defeats the purpose of pods. (If somebody knows a better way around editing pods and project simultanously, please let me know as well.)
Static Library/Frameworks: Rey Wenderlich has a good tutorial for creating frameworks. http://www.raywenderlich.com/65964/create-a-framework-for-ios

Related

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.

How to create reusable code in iOS?

I've been working on a mobile app for a couple of months. Now I want to develop other apps but reusing the code I've written. I'd like to have reusable code (ViewControllers) in order to be used in many projects. In this way, if there is some bug in one of these, I'd fix the bug and then apply the changes to all the projects that use my library. In short words, I'd like to know what is the best way to develop my own library for iOS with XCode. I've been developed for Android but I'm new in iOS development.
Is it possible to add my own library to CocoaPods?
Do you suggest any other alternative?
Thank you very much
Yes, you can create your private, internal, pods and make your applications depend on them. As an alternative you could use git submodules either.
But if you want you can even use both: having your private pods, which are also git submodules of your project, - they are usually called Development Pods - because you might want to fix a bug on your internal pod and push the fix immediately to the bleeding edge of your library as soon as you tested it on the application in which you spotted the bug in the first place.
A couple of interesting articles on this topic:
Working with internal pods
Development pods
On a totally side and obvious - I think - note, you can do this manually as pointed out by user1118321.
You can create a static library or a framework (shared library). From the "File" menu choose "New Project" and then click on "Framework&Library" under "iOS". Then choose "Cocoa Touch Static Library" or "Cocoa Touch Framework".

Can someone please explain the differences between Cocos2d-Swift, SpriteBuilder, Xcode and CocoaPods?

I'm completely confused and I don't know where to start asking questions. I tried googling, but the terminology is confusing and I'm not sure what either of these things do (except for Xcode). Can someone explain like I'm 5?
I'm on the cocos2d-swift website and after reading the getting started section it says "From this point onwards, using SpriteBuilder is optional.". I don't know what they mean by that.
How do each of these correlate with each other?
Also, how is an API Documentation Browser and Code Snippet Manager useful to an everyday iOS Developer?
cocos2d-swift is a framework that enables you to build things like sprite-based games quickly.
SpriteBuilder is a tool that helps you build your own multilayered sprites (images and animations grouped into a single package -- i.e. Mario, a Goomba, a Fireflower fireball, etc.).
Xcode is a developer environment in which you write your source code, compile, distribute, and test.
CocoaPods is a tool that fetches and manages framework/SDK dependancies.
You would use CocoaPods to fetch the cocos2d-swift framework so that you could build a sprite-based game in Xcode using sprites you generated in SpriteBuilder.
Not sure what Cocos2d is, but swift is the latest programming language by Apple for both OS X and iOS development.
http://en.wikipedia.org/wiki/Swift_(programming_language)
SpriteBuilder is a framework used to create games for iOS very quick. Think of it as a game engine.
http://www.spritebuilder.com/about
Xcode is the IDE (integrated development environment) that you use when writing native OS X and iOS applications. It's awesome!
CocoaPods is a way to load in third-party libraries and frameworks without having to manually install them on your own. It also makes it very easy to keep the frameworks up-to-date. Pods also allows your project to be more portable as it's much easier to install an application with multiple dependancies via Pods.
http://cocoapods.org
A documentation browser is good if you want to have access to documentation while offline. However, I almost always use Google to find what I'm looking for regardless of what technology I'm working on. Google is just the best way to search.
Finally, I'd start off with this book. I read the first edition years ago, and made things very easy for me to understand.
http://www.bignerdranch.com/we-write/ios-programming.html
Hope this helps!
Here are some basics:
XCode (A Program)- Most of your iOS development will happen here. Coding, creating the app etc.
Think of an SDK as a suite of commands or tools you can use-API's (API - Application programming interface)
Cocoas2d (An SDK) - Game engine. A software development kit for creating games. you would pull this library of code and tools into xcode to use it.
SpriteBuilder (An SDK) - Suite of tools for building games. Just like Cocoas, you would pull this into xCode to make use of it as you code.
CocoaPods - A tool for linking/loading SDK's into XCode and easily updating them.
Moral of the story: XCode is the software you will use for everything. Everything else are just additional libraries of code you can pull in.

Why doesn't Xcode have an ios framework option?

I've seen project such as ios-universal-framework, but I want to know why XCode iOS does not natively support having a framework. Is it some kind of legal issue. The static library option is not good enough because I want to be able to use .dylib files in my framework.
A little background on what I want to do with a framework. I have a project that is generated from Unity3D, and when we update, we have to manually add back all of our project changes.
What I want is to use a framework that can store most of those external libraries and resources to make it easier to upgrade our project when updates are released.
From a security perspective no code is allowed to be dynamically loaded, thus only static libraries are allowed.
It is possible to create static psudo-frameworks. Take a look at GitHub iOS-Universal-Framework.
What you need is a PosprocessBuilder as described in the build pipeline described in the Unity3d Documentation.
You can manage the Xcode configurations in this pipeline using scripts like the Xcode Zerg.
I've used one python script written by a guy called Calvin Rien that worked really well, if you want to know more about this script this blog post should give you a hint.
What you really need to look for to you automate the these steps is to look for posts of Continuous Integration using Unity 3d and iOS like this one:
Unity3d: from commit to deployment onto tester devices in 20 min using Jenkins

Resources