vokal / Xcode-Template

Xcode project template
MIT License
105 stars 22 forks source link

Vokal Xcode Project Templates

Maintained by @bryanluby

This repo contains Objective-C and Swift templates to start up a new Vokal project. These templates are a good start, but don't produce a ready-to-go project. Be sure to follow the steps in After creating a project each time you use one of these templates. Also note that creating the Xcode project is just one step in the process of setting up a new project; consult that documentation before following instructions here.

For people outside of Vokal: you'll need to make some adjustments after creating your project from these templates. In particular, you'll need to remove our private podspec repo from the Podfile, and update the certificate repo in fastlane/Matchfile. If you have issues beyond that, feel free to drop us a note.

Maintaining these templates

Apple doesn't have documentation on managing templates like this, but there is a third-party guide for Xcode 4 that's still mostly correct for Xcode 11.

If you're updating the templates, you'll note that there are Vokal-fied versions of several templates in this project - this is to facilitate making sure that certain stock files which would otherwise be created are not created. These were forked from the Xcode 7 templates, but as of Xcode 11, the base template had not changed significantly from the one included in 7.

Note that you may need to grab updated versions of these templates from the belly of Xcode when a new version of Xcode is released. As of Xcode 11, these templates can be found at the following paths:

You'll also note that we have separate templates for Swift and Objective-C - there were several features for the Swift template which simply did not work at all without ripping it out into a separate template. Common code is within the Vokal-Cocoa Touch Application Base.xctemplate folder.

Installation

To install or update the templates in Xcode:

After Creating A Project

1. Remove unnecessary references

2. If You Added The Starter Network Utility

If you chose to include the Starter Network Utility when creating the project, you get a bunch of tests for free! The bad news is that templates are dumb, so you have to move them around.

NOTE: For the VOKMockData folder make sure you've selected "Create folder references" so the mock data is added properly.

You can then delete the MoveToTestTarget folder from the filesystem as the test stuff has been moved over.

3. Cocoapod setup

4. For All Projects

Notes On Scripts

All scripts added to a given project will be added to the [project]/Scripts folder.

Build or Run scripts (designed to be run in conjunction with every single build or run which takes place within a given workspace) have been added to the appropriate place—either a post-build action or a Run Script Build Phase.

Scripts tied to code generation are added to Run Script Build Phases in the Code Generation Scripts target. This target must be run manually to generate boilerplate code.

For Objective-C projects, this target runs the scripts for Cat2Cat and Mogenerator. For Swift, it only runs Mogenerator, since R.swift serves the same purpose as Cat2Cat in Swift projects.

Adjust the run scripts in this target as necessary. For example, if your project isn't using Core Data, you can remove the Mogenerator script build phase. You can also add additional build phases if you need to run other scripts.

Version History