4D Blog

Home Product 4D for iOS: Easily interact with Apple Native apps

4D for iOS: Easily interact with Apple Native apps

October 6, 2021

Product

With 4D for iOS, we are always thinking about mobile-friendly features. The primary purpose is to help developers provide the best user experience for their mobile applications. And that’s why, with 4D v19 R3, we’re shipping action input controls.

What is an input control?

As a reminder, with formatters using iOS code available in the gallery, you can easily interact with native iOS apps from your mobile phone. For example, you can automatically dial a phone number by clicking on a phone number field or open the Safari App by simply clicking on a URL.

Action input controls follow the exact same logic. Using them, you will add some sorts of modules in your action forms to interact with Apple native apps. Several ones are already available in the gallery such as :

  • phoneContact: to search for a contact phone number directly from the Apple Contact app
  • emailContact: to search for a contact email directly from the Apple Contact app
  • currentLocation and currentLocationAddress: to fill the current location of the app user with coordinates (latitude and longitude) and addresses automatically.

They were designed to make your users’ lives easier by opening up new perspectives through smooth interactions with the iOS environment.

And best of all, you are totally free to create your own input controls, integrate them in your mobile projects, and share them with the community!

How does this work?

To use them in your mobile projects, you’ll need to include them in your database for formatters or custom list and detail forms. To do this, create a special “inputControls” folder, download the input control that suits you best from the gallery, unzip it and drag it into the inputControls folder.

This action input control will then be available and selectable in the Action section, in the parameter properties, depending on the type of your action parameter.

Here is an example

In our example, we are going to update a contact phone number and an email. The novelty here is that we are going to get data from the Apple Contact app. So, in that case, we simply use the phoneContact and the emailContact action input controls available in the gallery.

How it looks on the user’s app

The user will just have to select the editContact action from the action menu to display the action form in the mobile app. From there, the action input controls will then give him the ability to select a phone number and an email from the Apple Contact app.

blank 

So as you can see, action input controls are another great way to interact with Apple Native apps and add nice interaction in your mobile apps.

How it looks in the project editor

blank

Then, we need to create the edit action in the On Mobile App Action database method to get our example to work.

edit action 4D code

Here is an example of the 4D code in the On Mobile App Action database method, for the edit preset action, using the  MobileAppServer component:

#DECLARE($request : Object)->$response : Object
$action:=MobileAppServer.Action.new($request)
$response:=New object("success"; False)

Case of 
 : ($action.name="editContact") // edit@

  var $entity; $status : Object   
  $entity:=$action.getEntity()

  For each ($key; $request.parameters)
     $entity[$key]:=$request.parameters[$key]
  End for each

  $status:=$entity.save()  // save the entity

  If ($status.success)
    $response.success:=True  // notify App that action success
    $response.dataSynchro:=True  // notify App to refresh the selection
    $response.statusText:="Edited"
			
  Else 
    $response.statusText:="Failed to edit"  // $status.statusText
    $response.errors:=$status.errors
  End if 
End case 

As a reminder, the MobileAppServer component, which is built in 4D, gives you access to various utility methods to speed up your 4D mobile app backend coding.

Don’t hesitate to give us feedback on the 4D forum, and check out the documentation for more details!

Discuss

Tags 4D for iOS, Go mobile, Input control, Mobility, v19 R3, v20

Latest related posts

  • December 3, 2025

    Give AI to a 30 years old 4D application

  • November 28, 2025

    ORDA – Handle an event-driven logic during database operations

  • November 27, 2025

    ORDA – Permissions – Restrict / allow web access to the resources in one click

David Azancot
David Azancot
– 4D for iOS Product Owner – David Azancot joined the 4D Product team as a Product Owner in 2017. He is responsible for writing user stories and translating them into functional specifications. His role also includes ensuring that feature implementations meet customer needs. David holds an MBA in Marketing, Internet, and Mobility from the Institut Léonard de Vinci. He began his career in 2011 at a mobile startup that was later acquired by Madvertise (a mobile marketing group). Passionate about mobile interfaces, he was a 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

  • AI
  • 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 AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming 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