How to distribute custom xcode templates to developers? - ios

I am working on creating custom project templates using xcode 8.2.1. I know how to create a custom project template but my question is how do i distribute this to other developers. I cannot ask developers to copy paste the template folder i created every time in the Xcode templates path. Also maintaining template versions will be difficult. Instead is there any option to save my template code somewhere and upon clicking some installer it automatically download the dependencies and paste it in xcode template folder?
Any help is appreciated.

Related

Modifying Cordova iOS platform template -- linking frameworks?

I have been working on a Cordova project for both iOS and Android.
As part of the project as we will need to build a number of projects from a basic template.
I have done this by creating a template for the actual cordova project and also as part of it I pulled the cordova-ios-master code base for when we add the iOS platform. So we use our own cordova-ios-master due to some small modifications we needed to add.
With some of the plugins we have added / created we need to access SDK's / API's from some third party developers (this is mainly for some push notification services). Normally when we create the project and have added the platform we then need to add the linked frameworks using Xcode.
However I can see that within the cordova-ios-master there is the template Xcode project. I was hoping I could add the linked frameworks within this project so that they are already added when we first create the project and add the custom iOS platform.
What seems to be happening though is if I add the linked library into the template Xcode project and then save it. Once I then re-add that platform to the cordova project instead of the Xcode project being named after the cordova project name, it seems to have messed the re-naming of the Xcode project.
Below shows how the Xcode project normally appears when you add the libraries manually after adding the platform
So if i modify the Xcode template in cordova-ios-master, shown below....
You can see it already has a libCordova.a added.
I add one more and re-save the project.
But then when I add the platform to my project again from this source, i open the Xcode project for it and whilst my library is added, the project was named "myproject" but i can't choose to run it as the project selection seems to appear as "PROJECT_NAME" as opposed to being named and usable as "my project"....
Im fairly new to mac's and Xcode so maybe I'm doing something basic wrong.
Any suggestions or ideas would really help, I hope this post makes sense, it is a bit complex.
Thanks again
Rhys
Right I found a solution. I think I was looking at the problem the wrong way round. So if I need to add a framework for a particular plugin, rather than edit the Xcode project to add the framework. Cordova actually gives you the option to add certain frameworks from within the plugin.xml. Found this answer here....
How to copy a custom ios framework using plugin.xml on Phonegap 3
so I have added a required framework like so....
<framework src="src/ios/OtherLevels/OtherLevels.framework" custom="true" />
My bad!
-Rhys

Swift Custom Xcode Project Templates

I'm trying to create Xcode project templates with swift and got bit success but facing issues to load xib file
Error popup when xib selected in Xcode: "Interface Builder was unable to determine the type of "ViewController.xib". This may be due to a missing SDK."
anyone know how to create xib file in Xcode project template?
I have added project template at below path:
~/Library/Developer/Xcode/Templates/Project Templates/CustomTemplate/
and created below folders..
/Base.xctemplate
/Bundle Base.xctemplate
/iOS Application.xctemplate
/Swift Application.xctemplate
Few queries I have for Xcode template usage:
I have not found any apple documentation for creating Xcode project templates, so that mean apple stoped supporting to create Xcode custom project templates?
Swift apps allows to have custom Xcode project templates?
Apple will reject app submitted which was built with custom project templates?
Xcode custom project templates are better way to have it in practice or not?
All links and reference I found are upto Xcode4.x, is that mean no support available for Xcode project templates then after?
Reference:
http://www.telerik.com/blogs/how-to-create-custom-project-templates-in-xcode-7
any help will be appreciated..

How to customize ViewController template file for Xcode?

I want to add some stuff to the built-in UIViewController template for new Projects (for example, keyboard dismissal methods). I found this question that explains how to go into the Xcode bundle, and modify a particular class template. However, when I make a new iOS Project, the particular template that I find in the iPhoneOS folder is slightly different from the one that is actually used, and of course, my modifications to the template don't take effect (after restarting Xcode to make sure). (FYI, I am selecting iOS / Single View template to start the Project.)
Then, of course, how do you protect the customizations you make from updates to Xcode? I assume when the .app bundle is overwritten by a download from the App Store, it will overwrite all the templates?
You need to create a custom Xcode project template and tell that project template to use your customized ViewController file. Creating custom project templates is a royal pain and too large a subject to cover completely in an answer here. What I can answer here is where to place your custom templates so they don't get overwritten by Xcode updates. Place your custom project templates in the following folder:
/Users/Username/Library/Developer/Xcode/Templates/Project Templates/GroupName
Where GroupName is the group name on the left side of the New Project Assistant. You can create your own group name or use one of the existing group names.
A Google search for Xcode custom project templates uncovered the following article for Xcode 7 on the first page of results:
How to Create Custom Project Templates in Xcode 7
I wrote everything I know about creating custom Xcode project templates in the following article:
Creating Custom Xcode 4 Project Templates

Objective-C. Maintain and upgrade old project, so it could be putted in to the AppStore

I was send an old xCode project with app builded for iOS 4.3. What bothers me, that this project has multiple bundles within it and multiple files for loading each bundle with files in the xCode. As far as I know, thouse days, there was a such approach of coding - to split project in to the smaller projects. My goal is to change interface and put this project in to the AppStore.
I wonder:
Is it possible to make needed changes and send the project to the App Store as it is(multiple bundles with code files and launch files for xCode). If not, what should be done to accomplish this?
In the case if it is possible to send this project as it is - is there a way to convert all xib files from all bundles to one storyBoard?
Would be glad to hear answers and ofcourse some tips/advises from people, who are familiar with this situation.
P.S. By clicking the link, you can take a look how does the whole project folder looks. Every folder in the project folder has the same hierarchy as on the picture.
http://s11.postimg.org/n6j9kmr9f/Screen_Shot_2015_02_28_at_18_33_01.png

Worklight - Building iPhone environment

I am working on Worklight version 6.1.I have created a native ios environment.I added controller classes in the Xcode project and added native functionalities. I have added .js files in the eclipse project.Now I need build my iPhone environment.But I am afraid that native content (Xcode project) will get lost,after building the environment.What is the solution for this.
I should build at the same time native content shouldn't be lost.
How to do this...
Your explanation is VERY raw... it doesn't make much sense to me.
have created a native ios environment
What is that exactly? do you mean that you:
Created a Worklight project and added a Native API for iPhone, or
Created a Worklight project, added a Hybrid app and then added the iPhone environment to that application
Created a fully native project in Xcode?
The distinction between the 3 is important, and you need to mention this in your question in clear wording.
If what you mean is that you went with option 2 above, then your JS, CSS and HTML can be either in the common folder or in the environment folder.
If you then want to add native code, you need to first build your project and then open the generated Xcode project in Xcode, write native code and make sure to copy it back to your Worklight project in Eclipse.
I added controller classes in the Xcode project and added native
functionalities
Where did you add this? In which file? in the classes provided by Worklight in option 2 above, or in a new Class.
Either way, you need to bring these files back into Eclipse.
In Eclipse, you can create a iphone\nativeResources\Classes folder. During build-time in Eclipse, the files in this folder will be copied into the iphone\native\Classes folder, and when opened again in Xcode - your native code will be there...
Note: if you created your own class file, you will need to reference it in Xcode (right-click > add files...). Worklight cannot do this for you.
I believe your customizations should not be lost. Have you tried making the build already and your resources were overwritten?

Resources