UIReferenceLibraryViewController Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/UIKit.framework
Availability
Available in iOS 5.0 and later.
Declared in
UIReferenceLibraryViewController.h

Overview

A UIReferenceLibraryViewController object provides a dictionary service to look up the definition of a word or term from within an app. It should not be used to display wordlists, create a standalone dictionary app, or republish the content in any form.

You create and initialize a reference library view controller using the initWithTerm: method. You pass the term to define as the parameter to this method and the definition is displayed. You can present this view controller modally or as part of another interface. On iPad, you can set the reference library view controller as the content view controller of a UIPopoverController object. Optionally, use the dictionaryHasDefinitionForTerm: class method to check if a definition is available for a given term before creating an instance—for example, use this method if you want to change the user interface depending on whether a definition is available.

Tasks

Creating Reference-Library View Controllers

Class Methods

dictionaryHasDefinitionForTerm:

Returns whether a definition is available for the given term.

+ (BOOL)dictionaryHasDefinitionForTerm:(NSString *)term
Parameters
term

The term to be defined.

Return Value

YES if a definition for term is available; otherwise, NO.

Availability
  • Available in iOS 5.0 and later.
Declared In
UIReferenceLibraryViewController.h

Instance Methods

initWithTerm:

Initializes a newly created reference-library view controller to display the definition of the given term.

- (id)initWithTerm:(NSString *)term
Parameters
term

The term to define.

Return Value

The newly initialized reference library view controller.

Discussion

If a definition for the term is not available, a localized message is displayed instead. Use the dictionaryHasDefinitionForTerm: class method to determine whether a definition is available before creating instances of this class.

Availability
  • Available in iOS 5.0 and later.
Declared In
UIReferenceLibraryViewController.h