Please login

A CodeFlow blog

about live coding and more…

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.

Automatic creation of Lua action methods

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:

This video can not be played in your web browser...

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.

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:

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.

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).

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…

Last tweets

🎉🥂Time-Flow, an iOS app created with @celedev CodeFlow by @alf147 is on the AppStore! The approval process took less than 24 hours. 😎#LuaLang #livecoding #iOS itunes.apple.com/us/app/time-fl…

May 17, 2018

Apr 2, 2018

Minor CodeFlow update today: v1.2.3 fixes an issue with Xcode 9.3. Check for update or download it directly from celedev.com/en/download/

Apr 2, 2018

Feb 12, 2018

New CodeFlow version 1.2.2 today: it solves an error that could occur when calling certain kinds of Swift closures or ObjC blocks from Lua.Thanks @alf147 for reporting the issue! 😀Check for update in CodeFlow, or download version 1.2.2 from celedev.com/en/download/.