Telekinesis
Telekinesis allows you to change the design of your app in PaintCode, while the app is running on a real device.
Why “Telekinesis”?
telekinesis |ˌteləkiˈnēsis|
noun
the supposed ability to move objects at a distance by mental power or other nonphysical means.
How to use it?
To make Telekinesis work, you have to:
- Use PaintCode 3.
- Use StyleKit in your app.
- Include our Telekinesis.framework in your app.
- Connect your Mac and the iOS device to the same WiFi network.
Swift and Objective-C StyleKits are supported for both iOS and macOS.
Telekinesis is meant to be used only during development. You should not include the Telekinesis.framework in your app’s release builds.
How to integrate Telekinesis into your app
- Drag the framework to Embedded Frameworks or Embedded Binaries section of your target General panel.
-
Done! Run the app and you should see a message in console.
PaintCode Telekinesis is running...
Troubleshooting
Problem: Compilation fails with an error
- Framework must be added to the project and visible in Project Navigator.
- Build Phase Linked Binary with Libraries must include this framework.
- Build Phase Embed Frameworks must include this framework.
- Build Setting Framework Search Paths must include a path to this framework.
- Try adding “-ObjC” to Build Setting Other Linker Flags.
Problem: Framework prints message:
This application doesn’t have a StyleKit class named...
Make sure that StyleKit name in your PaintCode document and the StyleKit name in the app is the same.
Problem: Your device is not present in the popover.
Make sure the device runs compatible version of Telekinesis. A message with the version is being printed when the framework is initialized.
If you use App Sandbox, make sure the network communication is allowed.
Since Telekinesis uses Bonjour for discovery on local network, perform the standard procedure: turn it off and on again.
Technical details
- The iOS framework supports real devices and simulator.
- The frameworks are built using iOS 10 and macOS 10.12 SDKs.
- The magic is in exchanging the implementation of StyleKit methods.
- Your PaintCode document and the app on the device should use StyleKit with the same name.
- Wireless discovery uses Bonjour technology.
- Changes in PaintCode are transferred to the app over local network.
-
Telekinesis works best if you override
drawRect
methods of your views. -
If you use UIImages from StyleKit, listen to
TelekinesisDidChangeStyleKitNotification
and update them by calling the same StyleKit methods. - Changes made to your app by Telekinesis are not persistent and are reverted on next launch of the app.
- To keep the changes you made, re-export the StyleKit source code from PaintCode.