We have developed a module for an iPhone app that has a RootViewController:UIViewController that will sit as ONE tab bar item in a bigger iPhone app. We need to provide this module somehow to our client but we would like to satisfy the follo开发者_Python百科wing requirements:
1) The source code is not revealed
2) It is easy for the vendor to implement our UIViewController in his app.
If the UIViewController is written in code and doesn't rely on nibs, then I'd suggest using a static library. It's quite easy to create a static library as a fat binary (using the lipo tool) that clients can add to their projects. Only thing needed is the library file and the public header files.
If you do rely on nibs and you have images, localized texts, etc, then you'd prefer to distribute the code in a framework. I never tried it, but this guide should help you for those purposes: http://db-in.com/blog/2011/07/universal-framework-iphone-ios-2-0/
A few easy steps:
- Write documentation is the header files, use doxygen or headerdoc syntax.
- Build a static library, package it up with the header files.
- Write a sample application using the static library and headers only.
- Send the sample app to your client.
You want to create a framework. With a framework you can distribute a compiled version of your code with the .h files that you choose to publish.
I don't know of any example iPhone frameworks but open source Mac versions include Sparke, and Growl.
Here is Apple's documentation on creating a framework.
http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPFrameworks/Tasks/CreatingFrameworks.html
精彩评论