Code Generation
As you draw, PaintCode generates the drawing code on-the-fly. There are several settings that affect the code generation. You can access all of these conveniently in the middle toolbar, directly above the generated code. Note that you can drag the middle toolbar up or down, revealing as much of the generated code as you like.
Target
First and foremost, you have to choose between 7 targets:
- macOS ▸ Objective-C
- iOS ▸ Objective-C
- macOS ▸ Swift
- iOS ▸ Swift
- iOS ▸ C# Xamarin
- Android ▸ Java
- Web ▸ SVG
- Web ▸ JavaScript Canvas
- Web ▸ HTML + CSS
You can specify the target using the target popup button in the middle toolbar.
The target setting only affects the generated code, your drawing stays the same.
Minimum supported OS version
The second option allows you to specify the minimum supported OS version. For example, if you choose iOS 6+, it means that the generated code will only use APIs that were already available on iOS 6. Generally, you should select the minimal OS version you plan on supporting in your app.
Memory Management
For targets using Objective-C, there is also a memory management setting available. It allows you to choose between ARC (Automatic Reference Counting) or Retain/Release (manual memory management) memory management models.
Drawing origin
Finally, you can also specify the drawing origin. This is a per-canvas setting. The position of the (0, 0) point may vary, depending on where you move the drawing origin. For example, the default drawing origin is the lower left corner on macOS, but in the upper left corner on iOS.
Note that you can actually move the drawing origin by dragging the origin symbol in the canvas.