Folder Structure and Xcode Workspace for a Cocoapod

403 Views Asked by At

I would like to distribute some classes as a Cocoapod. I intend to provide the following:

  • The classes themselves (a few UIView subclasses)
  • A small example application

I have been looking through some well established Github projects and it looks like there is no single established way to set up my project. Should I use a single workspace with multiple projects? One project and one simple folder (for the views)?

enter image description here

enter image description here

enter image description here

One (perhaps obvious) requirement - once the structure is in place and the pod is downloaded, the example application should not be included.

Perhaps there are some tutorials out there? I've spent a few hours looking around and making some attempts but I'm invariably hitting some obstacle or another.

For example: If I have one project and one folder in the workspace (which I copied from TTTAttributedLabel) I can't get the library classes into the compile sources without them duplicating themselves into the demo project.

Each attempt seemed to hit a similar snafu so I'm hoping there's a 'right' way to do this.

1

There are 1 best solutions below

0
Ben Packard On

I found the following demo the simplest to reproduce: http://nilsou.com/blog/2013/07/21/how-to-open-source-objective-c-code/