Generating Source Code:
Create your image in Opacity.
Add a factory by selecting the Image > Add Factory menu item.
Change the new factory's Format pop up to Source Code.
Choose the language and settings you want.
Click the Build button to export your source code.
Drag the created source code into Xcode or to your web editing tool.