Add dy.dylib to an Xcode app project for linking and setup the project in TARGETS > [targetname] > Build Phases
Notice that the option Code Sign on Copy is selected, otherwise the whole bundle cannot pass code sign. In the screenshot, the text for Run Script is

"The Mach-O object file format used by Mac OS X for executables and libraries distinguishes between shared libraries and dynamically loaded modules. Use otool -hv some_file to see the filetype of some_file."

This comment has been minimized.

@qix, the shared library build modes are a "still being implemented" feature (especially on OSX) -- only some of the new buildmodes that Ian defined in the spec are implemented, and support across platforms is still quite limited.

You can help by playing with the feature and reporting rough edges in your specific cases.