Different AppDelegate and Storyboard files for different targets [duplicate] - ios

This question already has answers here:
How do I manage building a Lite vs Paid version of an iPhone app?
(6 answers)
Closed 4 years ago.
I have an XCode Project(iOS App for only iPhones) and I want to use same codebase for publishing different application. I have to change icon, name and design for this second application. Therefore, I did not use Localization.
Also in codebase, I need some variables to hold different keywords for different targets.
Is there any way to do it or I have to clone same project and change this files after?
Thanks.

Take a look at this question.
StackOverFlow Question
You will have to convert the code to swift but this gives you the basics to get started.

One workspace, two app targets, one set of code files.
Alternatively, use a framework. In that case it might be one workspace and two complete Xcode projects plus the framework.

Related

Convert Old Xcode Project to New

Let's say I found some source code from 3 years ago but now it doesn't run right due to xcode changes. Is there an easy and quick way to convert an old xcode project to work with the newest xcode?
There is no definite simple way to always correctly uplift an old codebase.
It depends if it's ObjC or Swift.
It depends which version of Xcode you're moving to.
It depends on the libraries the project links against.
etc etc etc.
If you edit your question to be more specific you will get more help.

What are ways to modularize an iOS App? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
If I have a big project and have several features. The features will be developed by another developer independently in another iOS project. The features can include UIViewcontrollers, Navigation and other things what an iOS app normally has. Then I have the main app where the feature projects will be integrated in an xcode workspace. How can I reference the other feature projects from the main app/projects? I tried loading a viewcontroller from a storyboard it seems not finding it. I also tried adding using build phases but I can't make it work.
I read this article Using CocoaPods To Modularize Big iOS Apps. The blog talks about using cocoapods which I am trying to avoid. I don't seem to find something that says it works with SVN which was the reason I wont use it for what I need. There is the framework option but Im looking for a better solution.
Cocoapods can help you integrate your subprojects in one main project. Besides cocoapods, you also need a modularization framework to help you use these subprojects's codes . For example, subproject A need to use subproject B's view controller, but A can't get the .h file in B, this is really a problem. I have an open source modularization framework in iOS named TinyPart, may can help you learn something about modularization in iOS. https://github.com/RyanLeeLY/TinyPart
have a look here for how to load other storyboard's view controllers from another project/framework. Not sure if its exactly what you are looking for but it seems like a similar problem
In your case under the guide linked in the link above, have a look at Developing the Framework as a Dependent Project
You might want to follow a proper pattern where software components are depending on an abstract instead of concrete implementation. Please check out http://www.oodesign.com/dependency-inversion-principle.html
Make the feature as a library project, it then can be developed separately and then stuck in a Sandbox project for development. When it is done, stick it back to your main project.
You should declare an interface (or in Objective-C you call it protocol) for that feature, so your main project knows how to use it. Make a dummy implementation of that protocol, stick it to the main project, so while the library is being developed, you can still go on with your main project's development.

In the osx/ios world, what is a library and what is a framework? [duplicate]

This question already has answers here:
What is the difference between a framework and a library? [closed]
(22 answers)
Closed 8 years ago.
I am learning development on osx and ios. So far, coding is ok. The most difficult is to handle all the files, all the configuration issues (of xcode), and so on. I thought hearing from a guru about libraries/frameworks would help me a lot!
I would like to know more about libraries and frameworks.
What is a library, what is a framework (and what's the difference between them)?
Where can I find a list of all the frameworks (of all the libraries?)? Or: what are the most important frameworks?
What can I do without any framework?
Your first question is very well explained here
Finding the right frameworks is half the fun coding with iOS. There are loads of lists out there and depending on what you are doing there are some frameworks that are very used. One great tool to look at is cocoapods. It can not only help you find frameworks but it also manages the frameworks in your project. Adding cocoapods in my opinion should be the fist thing you do in a project. All that said, my three favorite frameworks are:
AFNetworking: To handle network requests.
RestKit: To transform JSON into objects. (it's actually built on top of AFNetworking)
SVProgressHUD: A lightweight progress HUD
Finally you can do everything without ever using an external framework but why would you recode something that is already coded and battle tested.
In addition to my comment, some informations about frameworks on OS X/iOS.
A framework on OS X/iOS is a bundle used to distribute shared resources, including library code, resource files, header files… For more details see
A list of system frameworks available on OS X here

How to hide code in implimentation file in iOS [duplicate]

This question already has answers here:
How to build a framework or library for other developers, the secure way? [closed]
(3 answers)
Closed 8 years ago.
I have a developed a generic class and I want to give it to one of my friend.
How can I hide the code so that he should not view the logic in that. Can I do something like apple does by giving us only the .h files.
Please help me in achieving this. Thanks.
you need to create your own static library i.e. .a file in xcode. And it is not very tough, you can do this in just in few mins.
Read this tutorial and try in out:
How to make Universal Static library (.a file) in iOs using xCode
You will have to make your own library (framework) for this.
You can search about it there are many tutorials about that. One of them is How to build a framework or library for other developers, the secure way?
Edit: Great Tutorial
Creating Static Libraries For iOS

IOS arc disabling for part of code [duplicate]

This question already has answers here:
How can I disable ARC for a single file in a project?
(18 answers)
Closed 9 years ago.
I'm a newbie to IOS technology. I have been developing an app, in which I have to add around 10,000 mkannotations to my map. So I prefer to use clustering algorithm (probably using k_means). However, I found this beautiful external library at (https://www.cocoacontrols.com/controls/adclustermapview)
When I complied the example framework of this project and ran it on simulator everything works fine, however, when I add the required files to my project as they described, it raises a lots of errors regarding
retain
release etc.
So I understand there is some issue with the arc compatibility in the project
Here are my questions
These retain, release methods being used in some project, does
that mean that they are developed with old versions of IOS?
If so, how do I resolve these error, other than manually removing them?
Is there a method in IOS, which allows me to compile a code
partially using one compiler and the remaining using other?
Select desired files at Target/Build Phases/Compile Sources in Xcode
PRESS ENTER
Type -fno-objc-arc
Press Enter or Done
In xcode Edit-Refactor-Convert to Objective-C ARC select your app then check button.Finally click save button.
These retain, release methods being used in some project, does that
mean that they are developed with old versions of IOS? NO
If so, how do I resolve these error, other than manually removing
them?
Is there a method in IOS, which allows me to compile a code
partially using one compiler and the remaining using other? You can disable ARC for some files.
This problem might be coming because you must be using ARC in your project while this framework is not. To remove ARC for particular classes go to Targets, then build phases tab, under the compile sources group add '-fno-objc-arc' as the compiler flag. This will make sure that ARC is skipped while compiling this class..

Resources