Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Titanium Dictionary Module for iOS5+
Objective-C Python JavaScript Perl
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

benCoding.Dictionary Module

Use the native iOS dictionary service within your Titanium application. This module provides Titanium accessibility to Apple's native UIReferenceLibraryViewController introduced in iOS5.

Before you start

  • You need Titanium 1.8.1 or greater.
  • This module will only work with iOS 5 or great.

Download the release

There is two ways you can download this module. The go to the releases/UseIfDownloadingFromGithub folder. This will have a release compiled for anyone download it from github.

You can also download it for free from Appcelerator's marketplace here.

Building from source?

If you are building from source you will need to do the following:

  • Modify the titanium.xcconfig file with the path to your Titanium installation
  • Make sure the the method moduleGUID in the class BencodingDictionaryModule has the variable marketPlace set to NO. This will avoid you running into any licensing issues.


  • Download the latest release from the releases folder ( or you can build it yourself )
  • Install the bencoding.dictionary module. If you need help here is a "How To" guide.
  • You can now use the module via the commonJS require method, example shown below.

var referenceLibrary = require('bencoding.dictionary').createReferenceLibrary();

Now we have the module installed and avoid in our project we can start to use the components, see the feature guide below for details.

benCoding.Dictionary How To Example

For detailed documentation please reference this project's documentation folder. A code "How To" example is provided in the app.js located in the project's example folder.


This module provides access to most of the native UIReferenceLibraryViewController's functionality.

Below is a description and example on how to use each supported method.


This method returns a boolean indicator on whether or Apple's dictionary services are supported. Please note you need to target iOS 5 or greater to use the native UIReferenceLibraryViewController component.

The below sample shows how you can check if this feature is supported."This feature is only supported in iOS5 and above");"Check if we have the min OS version needed");
var featureSupported = referenceLibrary.isSupported();"Is Supported? => " + featureSupported);


This method returns a boolean indicator on whether or not the Apple Dictionary service was able to find the provided definition.

It is recommended that you use this method to first check if there is a definition available before opening a dialog for the definition.

The below sample shows how you can check if there is a definition available for your term."Does Apple know the meeting of life?");
var hasDefinition =  referenceLibrary.wordHasDefinition('life');"Definition found? => " + hasDefinition);


The showDialog method opens a modal dialog with the definition of the term provided. If the dictionary service is unable to find the definition the words "No definition found." will be displayed.

  • Callback methods are supported for the the "Error" and "On Close of Dialog" events.
  • The Dictionary module also supports the animated and modalTransitionStyle properties.

The below same shows how to use the showDialog method. For additional details please see the example and documentation folders within this project.

    //If you want you can define some callbacks
    function termDialogBoxHasBeenClosed(){"I'm a callback that you can use to tell when the Definition Dialog Box has been closed.");         
    function termDialogHadError(e){"I'm a callback that you can use to tell when the an error happens in the lookup process. This error is due to: "  + e.error);              
       "Add an event to be called if there is an error");
    referenceLibrary.addEventListener('errored', termDialogHadError);"Add an event to be called when the definition dialog is closed");
    referenceLibrary.addEventListener('closed', termDialogBoxHasBeenClosed);
    //Open the definition dialog window         
            term:'Life', //This is the term to search for (REQUIRED)
            animated:true, //Indicate if the dialog should be animated on open (OPTIONAL)
            modalTransitionStyle:Ti.UI.iPhone.MODAL_TRANSITION_STYLE_FLIP_HORIZONTAL //This is the transition style (OPTIONAL)

Demo Video

See the included sample app in action

Licensing & Support

This project is licensed under the OSI approved Apache Public License (version 2). For details please see the license associated with each project.

Developed by Ben Bahrenburg available on twitter @benCoding

Learn More


Please consider following the @benCoding Twitter for updates and more about Titanium.


For module updates, Titanium tutorials and more please check out my blog at benCoding.Com.

Something went wrong with that request. Please try again.