Giter VIP home page Giter VIP logo

custom-xcode-templates's Introduction

Custom Xcode Templates

Custom Xcode Project & File Templates

Last updated & tested using Xcode Version 4.6.1 (4H512).

Requirements

  • Get a new Mac running the latest version of OS X.
  • Connect it to the Internet.
  • Download and install the latest version of Xcode.

Installation

To download and install these custom templates in the correct directory on your Mac, open Terminal, and enter the following command.

git clone https://github.com/acani/custom-xcode-templates.git ~/Library/Developer/Xcode/Templates

Usage

Project Templates

To create a new project in Xcode, go to File > New > Project... (Shift-Command-N).

Choose Simple Application, under iOS > Application.

This custom project template is based on Xcode's built-in Empty Application project template. (To see how they differ, create two projects, one with each template. Then, diff them, e.g., diff -r ~/Projects/Empty/MyProject ~/Projects/Simple/MyProject.)

I prefer this template, but it has two small issues.

  1. http://stackoverflow.com/questions/15558953/xcode-project-template-add-file-to-the-project-group
  2. http://stackoverflow.com/questions/15559370/xcode-project-template-only-add-file-to-filesystem

For now, to manually circumvent these issues, follow the steps below after creating a new project with this template.

  1. Create a .gitignore file, which tells Git which files to ignore (not to track).

    Enter the following commands in Terminal.

     cd ~/Projects/MyProject          # changes directory to the project root directory
     echo .DS_Store  >  .gitignore    # overwrites .gitignore file with ".DS_Store"
     echo xcuserdata >> .gitignore    # appends xcuserdata to .gitignore file
     echo .idea      >> .gitignore    # appends .idea to .gitignore file
    
  2. In the Project Navigator, move the README.md file to the project group.

File Templates

To create a new file in Xcode, go to File > New > File... (Command-N).

Look for the "My Cocoa Touch" & "My Core Data" template groups.

These file templates mainly leave out the metadata comment headers.

Keep it clean & simple.

References

  • Directory locations of Apple's built-in Xcode templates.
    • /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/
    • /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/
  • Tutorial: A minimal project template for Xcode 4

License

Copyright (c) 2013 Acani

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

custom-xcode-templates's People

Contributors

ma11hew28 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.