Celedev Blog Archive

Old posts that were originally published on celedev.com

Celedev CodeFlow has now been renamed Bounces.

Some posts in this section may be outdated or not relevant anymore.
Please refer to the Home page and the Documentation section for current information about Bounces.

CodeFlow 1.0.2


CodeFlow 1.0.2 focuses on improving the Live Application Developer Experience

CodeFlow 1.0.2 is a minor release that focuses on improving the Live Application Developer's Experience.

It includes many small improvements and bug fixes in the following areas: automatic creation of Lua action methods, usability of the Lua editor, performance, project templates and live storyboard updates, Lua runtime robustness and native interface support.

Main Changes

This section list the most significant improvements and bug fixes in CodeFlow 1.0.2. For the complete change list, please see the version history in the CodeFlow readme file.

Automatic creation of Lua action methods

CodeFlow can now automatically create Lua action methods in your project to match IBAction methods defined in the associated Xcode project.

This is especially convenient when using Live Storyboards: you can define the action method associated to an interface component by control-dragging from this component to the corresponding View Controller source file in Xcode, and in CodeFlow, a Lua version of the new action method will magically appear in the corresponding Lua class extension, so you can directly write the action code and test it immediately in the target application.

Here is a short video (also available on Youtube) that illustrates this:

The creation of automatic action methods creation can be configured on a per-Lua-module basis (via a command in the Syntax menu).

Lua editor usability

In CodeFlow 1.0.2, we have improved many small details in the Lua code editor to make it more comfortable to use:

  • Easier type annotations: In CodeFlow you can insert type annotations in your Lua code to improve code-completion proposals for native properties and method names. But manually typing type annotation like --[[@type objc.UIPanGestureReognizer]] can become tedious and error-prone. Now, you can now simply insert a type annotation in your code using the command ⌥⌘T, and auto-completion of class and struct names is working inside type annotations comments. These improvements make type annotations very easy to use where needed in the code.

  • Added brief highlighting of counterpart syntax elements in the Lua editor when you enter code or move the selection. Highlighted elements include the usual set of brackets ( ) { } [ ], and also syntax block delimiters like do, if, while, repeat, function, else, elseif, end, until. Syntax counterpart highlighting can be disabled in the application preferences if you don't like it.

  • Much better behavior of Lua syntax auto-completion in the editor (e.g. the automatic insertion of missing strings terminators or of missing closing brackets): previously, syntax auto-completion could get really annoying sometimes by making deletion of the inserted characters or undo quite difficult; this is now fixed and syntax auto-completion should now be a transparent help when entering code. In addition, more syntax auto-completion patterns have been added, and you can now disable syntax auto-completion in the preference window if you don't want it.

  • Special characters and emojis are now correctly displayed inside Lua source code (special characters are valid inside Lua strings and comments).

Performance improvements

The two main performance optimizations in CodeFlow 1.0.2 are related to very different areas of the system: the first one is purely internal to the CodeFlow IDE, while the second one significantly decreases the debug overhead in target applications:

  • Highly improved display performance of Lua source code files in the editor. This better performance is especially noticeable when scrolling in big Lua source files.

  • Reduced the frequency of global variables refresh in the Variable Inspector while the target application is running. In previous versions, global variables refresh in debug mode could have a significant impact on CPU and network bandwidth in target applications with intensive code-driven animations, like 3D games. Now, the Variables Inspector is refreshed at most once per second when the target application is running.

Project templates and live storyboards

Storyboard-based project templates also have significant improvements in this version:

  • iOS project templates now have support for live update of presented View Controllers, like modal sheets or popovers.

  • During a live storyboard update, the saved state of a replaced View Controller is now applied in the replacing View Controller's viewDidLoad method. This makes the state propagation code in your project much simpler, because the controller's views hierarchy is guaranteed to be available when the state propagation code is executed.

  • During a live storyboard update, Root View Controllers (iOS, tvOS) and Window's Content View Controllers (macOS) are now correctly updated, even if their view is not created yet.

  • Live storyboard updates are now coordinated with project bindings update in case an action method has been added to the updated storyboard. This guaranties that the added action can not be triggered before being defined. This comes in addition to the existing coordination in case of added IBOutlet.
    You can see this coordination mechanism in action in the above video, around 01'12": the storyboard version containing the updateLabelSize UISlider action method (MainStoryboard-12:55:35) is loaded to the target application right after the version of the ViewController Lua module implementing this action method (ViewController-12:55:34), so that interacting with the slider can not cause a method-non-existing runtime error.
    Storyboard updates referencing new actions are now coordinated with code updates.

Lua CodeFlow runtime

In addition to a bunch of minor bug fixes and performance improvement in the Lua CodeFlow runtime library embedded in the target applications, CodeFlow 1.0.2 include a few noticeable improvements in this area:

  • It solves an issue causing a target application using SceneKit on iOS 10 to freeze when a texture resource was dynamically updated. More generally, classes or frameworks that use a shared lock to protect their internal structure (like SceneKit) can now be declared as such to the CodeFlow runtime, which removes the possibility of entering a deadlock when a method of these classes is called.

  • You can now specify custom bindings generation options for project bindings libraries: bindings generation options help the bindings generation process to build the Lua version of C / Objective-C APIs. They do this by providing indications that remove ambiguities in C function parameter types, especially when parameters are typed as pointers, and they can dramatically reduce the number of function or methods of the target native API not available to the Lua code in your project. Custom bindings generation options shall be defined in a file named 'CIMLuaBindingsOptions.plist' located in the same directory as the associated Xcode project.

Bug fixes

CodeFlow 1.0.2 fixes a crash that could occur if a Lua module in the project contained emojis (or other characters of Unicode supplementary planes).

Post a Comment


Recent posts

Blog Post
Aug 1, 2016

CodeFlow 1.0.2

CodeFlow 1.0.2 is a minor release that focuses on improving the Live Application Developer's Experience.

Aug 1, 2016
Blog Post
Jun 16, 2016

CodeFlow 1.0.1 and WWDC 2016

The just-released CodeFlow 1.0.1 brings support for the new iOS 10, tvOS 10 and macOS 10.12 announced at WWDC 2016 this week.

Jun 16, 2016
Blog Post
Jun 9, 2016

CodeFlow turns 1.0

It has been some time since the last beta of CodeFlow, version 0.9.20 was released in January this year. And all this time, we have worked very hard to improve CodeFlow, and to turn it into an effective Application Development System that we love to…

Jun 9, 2016
Blog Post
Apr 22, 2016

Live storyboards in CodeFlow

Live storyboards are a important feature of the upcoming CodeFlow 1.0. Mixing the power of Xcode storyboards with the flexibility of CodeFlow live coding, they are amazing for fast, fun and creative live app development.

Apr 22, 2016