Search code examples
cocoapodsxcode-project

Create new single view application for iOS using command-line tools


Is it possible to create a new single view application for iOS using Xcodeproj?

https://github.com/CocoaPods/Xcodeproj/issues/304#event-418686970

Thanks.


Solution

  • "Single View Application" in Xcode is just a template.

    Even in Xcode GUI, you could always create an empty project (not based on any particular template) and add the necessary new classes to it + configure the Info.plist appropriately so you'll end up with the same result as a project created using the template.

    An Xcode template is just to make your project creation easy by allowing to create pre-configured projects, but doesn't do anything you couldn't do yourself manually.

    So creating such a project using Xcodeproj is definitely possible, you just have to configure everything right to match what you have in the "Simple View Application" template (especially adding an properly configured Info.plist, an ApoDelegate and a ViewController to your project and maybe adjust its Build Settings — which are all possible using the Xcodeproj gem)

    You could also be interested in liftoff, which is a tool that actually uses Xcodeproj to make your new Xcode projects creation from the command line easy.