Database Reference
In-Depth Information
Figure 47—Reused text edit view controller
If the block returns a pass, the text view controller pops back to its parent.
With this design, we can use the PPRTextEditViewController to edit any piece of text
we choose, and it does not need any custom or special handling code. The
only thing we need to do for each instance is set up its view in the storyboard
and pass in the text that it needs to start with. By customizing the view, we
also gain access to which keyboard is appropriate for each text edit, thereby
making it easy to reuse this UIViewController for numeric text, email addresses,
or virtually any data we can think of.
The second function of the callback block is to update the data object and
the edit view. Since we are using static cells, we must grab a reference to the
existing cell and refresh it based on the text being passed into the block.
List Ingredients View Controller
While there are a couple of “select something” items in the PPREditRecipeViewCon-
troller , the ingredients selection is by far the most interesting. First, we want
to display all of the existing ingredients. To do this, we need a selection view
controller. Next, we want to add ingredients, which means we need to add an
 
 
 
Search WWH ::




Custom Search