How to create an Interface Builder plugin in XCode

2020-05-29 02:00发布

问题:

I need make an Object Library, an Interface Builder plugin like Mapkit so that user can drag my Custom Object and add to UIView.

As property, i want to show and configure it with my basic properties.

Any idea how to do this?

thanks.

回答1:

In Xcode 4.0, Apple has removed support for using custom Interface Builder palettes provided by IBPlugins in the Interface Builder editor. Xibs/Nibs that use such plugins will still compile but they cannot be edited. You'll need to install Xcode 3 (in a separate folder so as not to overwrite 4) and use it to edit xibs with custom palettes.

This is all in Xcode 4's release notes. Stay tuned to prerelease release notes for more updates on this matter.

Update for Xcode 6

Plugins are no longer necessary. See @IBDesignable and @IBInspectable. :-)



回答2:

You need to create an Interface Builder plugin for that; the static library has nothing Interface Builder knows how to work with.