4D Blog

Home Product Create a custom data formatter in 4D for iOS

Create a custom data formatter in 4D for iOS

February 4, 2019

Product

With 4D v17 R3, we introduced basic data formatters for dates, percentage, time, etc. 4D v17 R4 takes things a step further by providing you the ability to create your own data formatters and use them directly from the Project Editor.

In the 4D for iOS documentation, you’ll find a new Create data formatter chapter in the Data formatter section. It describes the entire process of data formatter creation. The easiest way to create your own formatter is to modify an existing example. For this, a Starter Project is available to help you build formatters to best suit your needs!

On the left below is an image of what we have before applying our formatters. The image on the right shows the result we want to achieve:

What changed ?

In this example we converted:

  • 1- integer enumeration into string for the job field: 3 becomes “Product Owner”
  • 2- integer enumeration into image for status field:1 becomes the “in progress” status icon
  • 3- text enumeration into string for the country field: FRA becomes “France”
  • 4- text enumeration into image for manager field: Eric becomes the “Eric’s profile” picture

 

The data formatter creation process is quite simple and allows you to add a new dimension to your apps just by using JSON files.

Happy formatting!

Discuss

Tags 4D for iOS, Formatter, Go mobile, Mobility, v17 R4, v18

Latest related posts

  • June 16, 2025

    Generate, share and use web sessions One-Time Passcodes (OTP)

  • May 20, 2025

    Automatic Refresh of OEM Build Licenses

  • May 16, 2025

    New class to handle incoming TCP connections

David Azancot
David Azancot
• 4D for iOS Product Owner •David Azancot joined the 4D Product team as a Product Owner in 2017. He's in charge of writing the user stories and translating them into functional specifications. His role also includes making sure that feature implementations meet customers' needs.David graduated with an MBA in Marketing, Internet and Mobility from the Leonard De Vinci Institute and began his career in 2011 with a mobile start-up company, later acquired by Madvertise (a mobile marketing group). Passionate about mobile interfaces, he was the natural choice to develop interactive mobile ad formats for the group in 2015. In parallel, David has been developing his own iOS and Android applications since 2012.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy