Telekinesis Beta

Telekinesis allows you to change the design of your app in PaintCode, while the app is running on a real device.

Try Telekinesis

To try Telekinesis you need to:

  1. Launch the Telekinesis Demo Project “Telekinesis Example.xcodeproj” either on simulator or on a physical device. Your Mac and the device have to be connected to the same network.
  2. Open the PaintCode document (“Example.pcvd”, enclosed in the project) in PaintCode 2.4 Beta.
  3. Click on the Telekinesis icon in the toolbar and you should see your device(s): Your DevicesYour Devices
  4. Click “Connect” button to establish a link between your device(s) and PaintCode. When the connection is established, Telekinesis icon will change to green:Toolbar icon when Telekinesis is connectedToolbar icon when Telekinesis is connected
  5. Now when you try to change any property of “Shape” in canvas “Star” you should see changes in your app running on the device or simulator. Change anything in the document and enjoy!

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 it works?

To make Telekinesis work, you have to:

Telekinesis works by exchanging the implementation of StyleKit for a new one while the app is running.

Telekinesis is meant to be used only during development; you should not include the Telekinesis.framework in your app's release builds. Telekinesis is currently only available for iOS and Objective-C projects.

Download the Telekinesis and PaintCode 2.4 Beta


How to integrate Telekinesis into your app

You need to have a working Xcode project of an app that uses PaintCode StyleKit to draw the UI:

  1. Add Telekinesis.framework to the Xcode project. Make sure that the Add to target checkbox is turned on. (Select File > Add Files to "<name of your project>")Add Framework to your projectAdd Framework to your project
  2. Select the Telekinesis.framework in the Project navigator (Panel on the left) Select the Telekinesis frameworkSelect the Telekinesis framework
  3. Remove the framework from each target in the File Inspector (Panel on the right). Remove the framework from each targetRemove the framework from each target Removing the framework from the target just after adding it might seem odd. But if you add the file with target checkbox turned on (step 1), Xcode automatically sets an important build setting for you. On the other hand it is better to remove the membership (step 3) so that the framework is not used in the release build.
  4. Add
    -ObjC -framework Telekinesis 
    to Other Linker Flags under Debug configuration. This will ensure you won’t bundle the framework to the App Store builds.Link Framework in DebugLink Framework in Debug
  5. Launch your app and you should see a message in console:
    PaintCode Telekinesis is running...
    
  6. Open your StyleKit in PaintCode 2.4, click on the Telekinesis icon in the toolbar and you should see your device(s):Your DevicesYour Devices
  7. Click “Connect” button to establish a link between your device(s) and PaintCode. When the connection is established, Telekinesis icon will change to green:Toolbar icon when Telekinesis is connectedToolbar icon when Telekinesis is connected
  8. Now you should see changes in your app, when you try to change any property of any shape in any canvas used in your app. Change anything in the document and enjoy!
  9. To perform custom updates on StyleKit change, import Telekinesis and observe TelekinesisDidChangeStyleKitNotification. Make sure this code is compiled only on Debug configuration:
    #if DEBUG
        #import <Telekinesis/Telekinesis.h>
    #endif
    

Technical details

Troubleshooting

Problem: Compilation failed with this error:

Undefined symbols for architecture armv7:
  "_TelekinesisDidChangeStyleKitNotification", referenced from: ...

Solution: The framework is not being linked. If you are building Debug configuration, add this to Other Linker Flags:

 -ObjC -framework Telekinesis
 

If you are building Release configuration, use #if DEBUG on lines which use TelekinesisDidChangeStyleKitNotification.

Problem: Compilation yields this warning:

Auto-Linking supplied '.../Telekinesis.framework/Telekinesis', framework linker
option at .../Telekinesis.framework/Telekinesis is not a dylib

Solution: No idea what that means, but just add #if DEBUG ... #endif around Telekinesis import statement.

Problem: You connect PaintCode to your app, but the framework prints this:

Telekinesis: This application doesn’t have a StyleKit class with name ...

Solution: StyleKit name in your PaintCode document (.pcvd) and in your app must match.

Problem: Your device didn’t appear in PaintCode.

Solution: Make sure your Mac and iOS device are on the same WiFi network. If it still doesn't work after that, it is a network issue, in which case, wait for the next full moon, bring candles, and a lamb…