Inherits from OCRBaseDetailViewController : UIViewController
Conforms to UIScrollViewDelegate
UITextFieldDelegate
Declared in OCRResumeOverviewViewController.h
OCRResumeOverviewViewController.m

Overview

Manage the Overview information of a resume object.

Properties

atLabel

IBOutlet to the “at” label.

@property (weak, nonatomic) IBOutlet UILabel *atLabel

Discussion

Declared so the UIFont can be dynamically re-sized.

Declared In

OCRResumeOverviewViewController.h

contentView

IBOutlet to the contentView containing all the UI elements.

@property (weak, nonatomic) IBOutlet UIView *contentView

Declared In

OCRResumeOverviewViewController.h

currentJobName

IBOutlet to the name of the current job.

@property (weak, nonatomic) IBOutlet UILabel *currentJobName

Declared In

OCRResumeOverviewViewController.h

currentJobTitle

IBOutlet to the title of the current job.

@property (weak, nonatomic) IBOutlet UILabel *currentJobTitle

Declared In

OCRResumeOverviewViewController.h

hmLabel

IBOutlet to the “Hm” label.

@property (weak, nonatomic) IBOutlet UILabel *hmLabel

Discussion

Declared so the UIFont can be dynamically re-sized.

Declared In

OCRResumeOverviewViewController.h

mbLabel

IBOutlet to the “Mb” label.

@property (weak, nonatomic) IBOutlet UILabel *mbLabel

Discussion

Declared so the UIFont can be dynamically re-sized.

Declared In

OCRResumeOverviewViewController.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

OCRResumeOverviewViewController.m

resumeCity

IBOutlet to city of the resume.

@property (weak, nonatomic) IBOutlet UITextField *resumeCity

Declared In

OCRResumeOverviewViewController.h

resumeEmail

IBOutlet to the email of the resume.

@property (weak, nonatomic) IBOutlet UITextField *resumeEmail

Declared In

OCRResumeOverviewViewController.h

resumeHomePhone

IBOutlet to the home_phone of the resume.

@property (weak, nonatomic) IBOutlet UITextField *resumeHomePhone

Declared In

OCRResumeOverviewViewController.h

resumeMobilePhone

IBOutlet to the mobile_phone of the resume.

@property (weak, nonatomic) IBOutlet UITextField *resumeMobilePhone

Declared In

OCRResumeOverviewViewController.h

resumeName

IBOutlet to the name of the resume.

@property (weak, nonatomic) IBOutlet UITextField *resumeName

Declared In

OCRResumeOverviewViewController.h

resumePostalCode

IBOutlet to the postalCode of the resume.

@property (weak, nonatomic) IBOutlet UITextField *resumePostalCode

Declared In

OCRResumeOverviewViewController.h

resumeState

IBOutlet to the state of the resume.

@property (weak, nonatomic) IBOutlet UITextField *resumeState

Declared In

OCRResumeOverviewViewController.h

resumeStreet1

IBOutlet to street1 of the resume.

@property (weak, nonatomic) IBOutlet UITextField *resumeStreet1

Declared In

OCRResumeOverviewViewController.h

resumeSummary

IBOutlet to the summary of the resume.

@property (weak, nonatomic) IBOutlet UITextView *resumeSummary

Declared In

OCRResumeOverviewViewController.h

scrollView

IBOutlet to the scrollview

@property (weak, nonatomic) IBOutlet UIScrollView *scrollView

Declared In

OCRResumeOverviewViewController.h

Instance Methods

configureDefaultNavBar

Configure the default items for the navigation bar.

- (void)configureDefaultNavBar

Declared In

OCRResumeOverviewViewController.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

OCRResumeOverviewViewController.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, Save, or Cancel buttons.

Declared In

OCRResumeOverviewViewController.m

configureView

Configure the view items.

- (void)configureView

Declared In

OCRResumeOverviewViewController.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

OCRResumeOverviewViewController.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

OCRResumeOverviewViewController.m

keyboardWillShow:

Invoked when the keyboard is about to show

- (void)keyboardWillShow:(NSNotification *)aNotification

Parameters

aNotification

the NSNotification containing information about the keyboard

Discussion

Scroll the content to ensure the active field is visible

Declared In

OCRResumeOverviewViewController.m

loadViewFromSelectedObject

Update the data fields of the view from the resume managed object.

- (void)loadViewFromSelectedObject

Declared In

OCRResumeOverviewViewController.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

OCRResumeOverviewViewController.m

populateFieldsFromSelectedObject

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

- (void)populateFieldsFromSelectedObject

Declared In

OCRResumeOverviewViewController.m

reloadFetchedResults:

Reloads the fetched results

- (void)reloadFetchedResults:(NSNotification *)aNote

Parameters

aNote

the NSNotification describing the changes (ignored)

Discussion

Invoked by notification when the underlying data objects may have changed

Declared In

OCRResumeOverviewViewController.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

OCRResumeOverviewViewController.m

textFieldDidBeginEditing:

Tells the delegate that editing began for the specified text field.

- (void)textFieldDidBeginEditing:(UITextField *)textField

Parameters

textField

The text field for which an editing session began.

Discussion

This method notifies the delegate that the specified text field just became the first responder. You can use this method to update your delegate’s state information. For example, you might use this method to show overlay views that should be visible while editing.

Implementation of this method by the delegate is optional.

In our case, we set the activeField property which is used in in the calculation to scroll fields so they are visible when the keyboard is on-screen.

Declared In

OCRResumeOverviewViewController.m

textFieldDidEndEditing:

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

- (void)textFieldDidEndEditing:(UITextField *)textField

Parameters

textField

The text field 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

OCRResumeOverviewViewController.m

textFieldShouldReturn:

Asks the delegate if the text field should proc

- (BOOL)textFieldShouldReturn:(UITextField *)textField

Parameters

textField

The text field whose return button was pressed.

Return Value

YES if the text field should implement its default behavior for the return button; otherwise, NO.

Discussion

The text field calls this method whenever the user taps the return button. You can use this method to implement any custom behavior when the button is tapped.

In our Storyboard scene, we set the textfield tag values incrementally, and then use the tag of the current textField responder to determine what to do next. We also set the other keyboard atttributes appropriately for] the data type we expect to see, and in particular set the return key to “Next” if hitting return will advance the user to the next field.

Note the specific check for the date fields, in which case we bring up the data picker.

Declared In

OCRResumeOverviewViewController.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

OCRResumeOverviewViewController.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

OCRResumeOverviewViewController.m

updateSelectedObjectFromUI

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

- (void)updateSelectedObjectFromUI

Declared In

OCRResumeOverviewViewController.m

userTextSizeDidChange:

Handle the notification that the user changed the dynamic text size.

- (void)userTextSizeDidChange:(NSNotification *)aNotification

Parameters

aNotification

The NSNotification associated with the event.

Discussion

This method is invoked by notification when the user changes the text size. We apply a new UIFont instance to each label, text field, and text view that uses dynamic font styles.

Declared In

OCRResumeOverviewViewController.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

OCRResumeOverviewViewController.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

OCRResumeOverviewViewController.m