DEV Community

Michael Gangolf
Michael Gangolf

Posted on

Titanium News #19

Older posts can be found here.

Intro

It's Titanium News time again! This time we will look at 12.3.1.GA, 12.4.0.RC, module updates and how to use ChatGPT to create Titanium iOS modules.

Titanium 12.3.1.GA

The latest GA release 12.3.1 was published in June and fixed some issues that people reported with 12.3.0. The main part was related to Apples new privacy requirements in case you are using filesystem APIs like createdAt() or modifiedAt(). Support for iOS multi-scene apps has been removed for now as it introduced some issues for normal apps. It will be revised in future releases.
On the Android side you can now use switchCamera again when your app is not using useCameraX and touchFeedbackColor is fixed for BottomNavigation tabs.
One new features is also included: You can use platform dependend <id> blocks in your tiapp.xml now:

<id platform="android">com.miga.test_android</id>
<id>com.miga.test</id>
Enter fullscreen mode Exit fullscreen mode

We all have an app where you had to switch ids and now you can have it in one tiapp.xml file!

Titanium 12.4.0.RC

A first test version of Titanium 12.4.0 was released this week. Since Google updated their store requirement a bit early you have to target Android API level 34 for new apps now. You can always update the level by hand by adding this to your tiapp.xml:

<android>
    <manifest>
        <uses-sdk android:targetSdkVersion="34"/>
    </manifest>
</android>
Enter fullscreen mode Exit fullscreen mode

but in case you are using BroadcastReceiver in your app you have to update to 12.4.0.RC as it required a code change. So in case you see this error One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts when your build your app for targetSdkVersion 34 you have to update the Titanium SDK.

But 12.4.0 doesn't just include that change, it also has some nice new features and bug fixes.

  • add swipe actions support for Ti.UI.TableView (video)
  • Android: add moveToBackground method
  • Android: option to hide scrollbars in a WebView
  • Android: missing Event.remove() method was added
  • Android: parity for OptionBar color properties
    optionbar

  • Android: track colors in a Switch
    switch

  • Android: text alignment for date pickers
    datepicker

  • Android: video playback speed

  • Android: defaultLang option in tiapp.xml (in case you run an app that doesn't have EN as the first language)

  • iOS: iOS 17 symbol effects (video)

  • iOS: backgroundColor for RefreshControl

Image description

  • iOS: overrideUserInterfaceStyle a Picker

Preview

The task list for the next big Titanium release will include iOS 18 support and Android API level 34 by default. There are still plenty of pull requests in the queue https://github.com/tidev/titanium-sdk/pulls like "flatten ListView layout" for Android that improves the performance in complex template setups and bigger changes like the upgrade to gradle 8.
If you find bugs or need a feature feel free to create an issue at https://github.com/tidev/titanium-sdk/issues so Titanium developers can look at it.

Modules

Module developers have been busy updating their modules and creating some new ones. Here is a quick list of some of those:

I'm sure I've missed some :) So feel free to leave a comment for new modules, updates or if you'll need some module updates.

Spotlight

Using ChatGPT to create a custom iOS module.

Multiple Titanium users are leveraging ChatGPT to support them in building apps and modules. As mentioned in the last Titanium News there is also a Titanium ChatGPT copilot at https://chat.openai.com/g/g-ZNwI6zmBi-titanium-copilot.
The following are the prompts that were used to create the Social share module:

Creating a module for Titanium (Appcelerator) to share an image via text, email, Instagram, Facebook, or save to the local gallery requires several steps. Below is a detailed guide and sample code for creating an iOS module compatible with the latest version of Xcode and Swift.

To get basic instructions to setup a new module, the first code and compile instructions.

what do I name the new swift file I'm creating and where should it be placed?

Returned detailed instructions where you have to place the files in your directory and what to put in each file.
Even switching to Objectiv-C with

If I want to use obj-c what would the code look like?

was answered right away with new code.
Even errors like

I'm having issues with this: - (void)share:(id)args; - I'm getting the following errors: expected ';' at end of declaration list. Expected member name or ';' after declaration specifiers. Type name requires a specifier or qualifier

or

at UIImage I'm getting this error: Definition of 'TiBlob' must be imported from module 'TitaniumKit.TiBlob' before it is required

were fixed with the results by ChatGPT.

Sometimes it will return old appc ti commands but it's easy to use ti instead.

Have a look at the full conversation at https://www.fromzerotoapp.com/create-a-titanium-ios-module-with-chatgpt/

If you create some new module leave a comment and I'll feature it next time.

That's it

If you have feedback or some interesting Titanium SDK apps, modules or widgets you would like to share: get in contact with me or leave a comment and I'll add it to the next Titanium news.

Top comments (0)