Inherits from OCRBaseDetailViewController : UIViewController
Conforms to OCRDetailViewProtocol
UISplitViewControllerDelegate
UITextViewDelegate
Declared in OCRCoverLtrViewController.h
OCRCoverLtrViewController.m

Overview

Manage cover letter objects.

Properties

coverLtrFld

IBOutlet to the cover letter text

@property (nonatomic, weak) IBOutlet UITextView *coverLtrFld

Declared In

OCRCoverLtrViewController.h

noSelectionView

Reference to the noSelection view, which is displayed when there is no object to manage, or a containing parent object is deleted.

@property (strong, nonatomic) OCRNoSelectionViewController *noSelectionView

Declared In

OCRCoverLtrViewController.m

scrollView

IBOutlet to the scrollView

@property (nonatomic, weak) IBOutlet UIScrollView *scrollView

Declared In

OCRCoverLtrViewController.h

Instance Methods

configureDefaultNavBar

Configure the default items for the navigation bar.

- (void)configureDefaultNavBar

Declared In

OCRCoverLtrViewController.m

configureFieldsForEditing:

Enables or disables all the UI text fields for editing.

- (void)configureFieldsForEditing:(BOOL)editable

Parameters

editable

A BOOL that determines whether the fields should be enabled for editing - or not.

Discussion

As a resume app, a major Use Case is the user sharing his/her experience by passing the iOS device around. To avoid accidently changing information, the app defaults to non-editable and there is an explicit Edit button when the user wants to change information. This method sets the enabled state as appropriate and also changes the background color to make “edit mode” more visually distinct.

Declared In

OCRCoverLtrViewController.m

configureUIForEditing:

Set the UI for for editing enabled or disabled.

- (void)configureUIForEditing:(BOOL)isEditingMode

Parameters

isEditingMode

YES if we are going into edit mode, NO otherwise.

Discussion

Called when the user presses the Edit, Done, or Cancel buttons.

Declared In

OCRCoverLtrViewController.m

configureView

Configure the view items.

- (void)configureView

Discussion

This method is called when the selectedManagedObject changes.

Declared In

OCRCoverLtrViewController.m

didPressCancelButton

Invoked when the user taps the Cancel button.

- (void)didPressCancelButton

Discussion

  • End the undo group on the NSManagedObjectContext.
  • If the undoManager has changes it canUndo, undo them.
  • Cleanup the undoManager.
  • Reset the UI to its default state.

Declared In

OCRCoverLtrViewController.m

keyboardDidShow:

Invoked when the keyboard is about to show.

- (void)keyboardDidShow:(NSNotification *)aNotification

Parameters

aNotification

the NSNotification containing information about the keyboard.

Discussion

Adjust the scrollview contentInsets to ensure the content of the textView can be scrolled by the user to wherever they wish to edit the text.

Declared In

OCRCoverLtrViewController.m

keyboardWillBeHidden:

Invoked when the keyboard is about to be hidden.

- (void)keyboardWillBeHidden:(NSNotification *)aNotification

Parameters

aNotification

the NSNotification containing information about the keyboard.

Discussion

Reset the contentInsets to “zero”.

Declared In

OCRCoverLtrViewController.m

loadViewFromSelectedObject

Update the text fields of the view from the selected cover_ltr.

- (void)loadViewFromSelectedObject

Declared In

OCRCoverLtrViewController.m

packageWasDeleted:

Update internal state of the view controller when a package has been deleted.

- (void)packageWasDeleted:(NSNotification *)aNotification

Parameters

aNotification

The NSNotification object associated with the event.

Discussion

Invoked by notification posted by OCRPackagesViewController when it performs a package deletion.

Declared In

OCRCoverLtrViewController.m

populateFieldsFromSelectedObject

Populate the user interface fields with data from the object we are managing.

- (void)populateFieldsFromSelectedObject

Declared In

OCRCoverLtrViewController.m

reloadFetchedResults:

Reloads the fetched results.

- (void)reloadFetchedResults:(NSNotification *)aNote

Parameters

aNote

the NSNotification describing the changes.

Discussion

Invoked by notification whhen the underlying data objects may have changed.

Declared In

OCRCoverLtrViewController.m

setEditing:animated:

Sets whether the view controller shows an editable view.

- (void)setEditing:(BOOL)editing animated:(BOOL)animated

Parameters

editing

If YES, the view controller should display an editable view; otherwise, NO. If YES and one of the custom views of the navigationItem property is set to the value returned by the editButtonItem method, the associated navigation controller displays a Done button; otherwise, an Edit button.

animated

If YES, animates the transition; otherwise, does not.

Discussion

Subclasses that use an edit-done button must override this method to change their view to an editable state if editing is YES and a non-editable state if it is NO. This method should invoke super’s implementation before updating its view.

Declared In

OCRCoverLtrViewController.m

textViewDidEndEditing:

Tells the delegate that editing of the specified text view has ended.

- (void)textViewDidEndEditing:(UITextView *)textView

Parameters

textView

The text view in which editing ended.

Discussion

Implementation of this method is optional. A text view sends this message to its delegate after it closes out any pending edits and resigns its first responder status. You can use this method to tear down any data structures or change any state information that you set when editing began.

Declared In

OCRCoverLtrViewController.m

textViewShouldBeginEditing:

Asks the delegate if editing should begin in the specified text view.

- (BOOL)textViewShouldBeginEditing:(UITextView *)textView

Parameters

textView

The text view for which editing is about to begin.

Return Value

YES if an editing session should be initiated; otherwise, NO to disallow editing.

Discussion

When the user performs an action that would normally initiate an editing session, the text view calls this method first to see if editing should actually proceed. In most circumstances, you would simply return YES from this method to allow editing to proceed.

Implementation of this method by the delegate is optional. If it is not present, editing proceeds as if this method had returned YES.

Declared In

OCRCoverLtrViewController.m

updateSelectedObjectFromUI

Update the selected object’s properties from the view’s data fields

- (void)updateSelectedObjectFromUI

Declared In

OCRCoverLtrViewController.m

userTextSizeDidChange:

Called when the user changes the size of dynamic text.

- (void)userTextSizeDidChange:(NSNotification *)aNotification

Parameters

aNotification

The notification sent with the UIContentSizeCategoryDidChangeNotification notification

Declared In

OCRCoverLtrViewController.m

viewDidLoad

Called after the controller’s view is loaded into memory.

- (void)viewDidLoad

Discussion

This method is called after the view controller has loaded its view hierarchy into memory. This method is called regardless of whether the view hierarchy was loaded from a nib file or created programmatically in the loadView method. You usually override this method to perform additional initialization on views that were loaded from nib files.

Declared In

OCRCoverLtrViewController.m

viewWillAppear:

Notifies the view controller that its view is about to be added to a view hierarchy.

- (void)viewWillAppear:(BOOL)animated

Parameters

animated

If YES, the view is being added to the window using an animation.

Discussion

This method is called before the receiver’s view is about to be added to a view hierarchy and before any animations are configured for showing the view. You can override this method to perform custom tasks associated with displaying the view. For example, you might use this method to change the orientation or style of the status bar to coordinate with the orientation or style of the view being presented. If you override this method, you must call super at some point in your implementation.

For more information about the how views are added to view hierarchies by a view controller, and the sequence of messages that occur, see “Responding to Display-Related Notifications”.

Note If a view controller is presented by a view controller inside of a popover, this method is not invoked on the presenting view controller after the presented controller is dismissed.

Declared In

OCRCoverLtrViewController.m