For me, I would make a static library project that contains common code (the UI element in your example) in Xcode.
Then, when I need to use the library in the iPhone or iPad application project, I can just reference the static library project by dragging the project into the Project Navigator and setting the correct dependency, the library used and the header search path, Thus, you always have one source source library code to simplify maintenance and modification.
Of course, you can compile the static library into a binary file and link it to your project, but it is not too flexible when you find errors in your static library and you need to switch to another project to fix the error, and then compile and copy the file binary library.
I just wrote an article (link below) on how to link a static library project with an iOS project on Xcode 4.3.2. It may be useful for you to solve a problem that you did not find. I hope for this help.
http://vicidi.wordpress.com/2012/04/11/linking-an-ios-static-library-project-in-another-project-in-xcode-4-3-2/
source share