concept row in category ios

This is an excerpt from Manning's book iOS Development with Swift.
Select the table view in the Document Outline. Notice in the Attributes Inspector that the content of the table view is using Dynamic Prototypes by default (see figure 9.5). Table views can use one of two types of cells: Because the books in the Bookcase app will eventually change over time, and each cell will have the same layout, a table view with dynamic prototypes is ideal for our example.
- Static cells— Use table views with static cells to build up a static design using a table. The number of rows in a table with static cells is set at design time, and each cell has its own unique design. A list of customizable settings in an app could be a good candidate for a table using static cells.
- Dynamic prototypes— Use table views with dynamic prototypes to build a table with content that can change at runtime and/or where cells have the same layout. A table view set to dynamic prototypes will automatically give you a prototype cell to customize the look of the cells in the table.
You can’t let the user add rows without letting them delete! It’s surprisingly straightforward to implement row deletion in tables with a fancy swipe mechanism (see figure 9.22).
First, add a removeBook method to the BooksManager to handle removing a book from the books array: Swiping left to delete is already built into table views in UIKit—when the user confirms they’d like to delete a row, a data source method will be called. All you need to do is override this method in BooksTableViewController and double-check that the user is requesting to delete a row.func removeBook(at index: Int) { books.remove(at: index) }func removeBook(at index: Int) { books.remove(at: index) }You can now make the appropriate change to update both the data and the table, identifying the row to delete with the index path parameter. Request the booksManager to remove the book from the books array, and the tableView to delete the row: override func tableView(_ tableView: UITableView, 1 commit editingStyle: UITableViewCellEditingStyle, 1 forRowAt indexPath: IndexPath) { 1 if editingStyle == .delete { 2 booksManager.removeBook(at: indexPath.row) 3 tableView.deleteRows(at: [indexPath], with: .fade) 4 } }
- 1 Overrides table view method
- 2 Checks user requested deletion
- 3 Removes book from array
- 4 Removes book from table

This is an excerpt from Manning's book Anyone Can Create an App: Beginning iPhone and iPad programming.
The first function you added is to return the number of rows in section. You can see that it has -> Int at the end of the method, so it is expecting the function to return an Int. This is called the return type of a function and is part of the function definition. You’ll eventually return the number of rows in your data source, but for now return 1. Add the line return 1 inside the curly brackets for that method. Yeah! One of errors is fixed. Now you need to fix the second one.
The second method you added is asking for the cell that should be displayed at an index path. What is an index path, anyway? Officially speaking, it’s a path into a specific node in a tree of nested array collections. Clear as mud, right? The index path is basically the index of the row of data you want, but it’s robust enough that if you had an array with one or more arrays inside it, you could get to the data you needed easily. In this case, though, you’re only going to have one array of data, so consider it a simple index of an array. (Remember, arrays start at base 0, so if you wanted the first row, you’d ask for array[0] to get the first row. In this case, the 0 is the indexPath.)
To recap where you are with the app: you’ve created the new app with a tableView to hold the data. The data in the table is still hardcoded, but when you click the row, it opens the detail view, which displays the details of your Lion object. You can also click Back to go back to your view of all the Lion objects. This is a lot of functionality without writing a lot of code. Apple tries to make it as easy as it can for programmers by doing a lot of the plumbing behind the scenes so we don’t have to.
The lionData array in the MainViewController holds the LioN objects you’ve created so far (“Wendy’s toothpaste” and “bad toothpaste,” in my case). You know that there are exactly the same number of LioN objects in this array as there are in the table, because the array is the data source for the table. So the tableView created one row for each LioN in the array lionData. This means you know the number of rows in the table by counting the number of objects in the lionData array. Add this code to the addItem() function in your MainViewController:
Not surprisingly, you’re calling the insertRowsAtIndexPaths function of the table-View and passing in two arguments: indexPaths and the type of animation you want. You pass in the row animation type, which is an animation of how the row appears when it’s inserted. Many options are enumerated for you (figure 20.7)—you can see these when you type the entire line of code up to the .Automatic and let Xcode show the values that are available. You can set the animations to the different options to see what they do, but I recommend using Automatic.

This is an excerpt from Manning's book iOS 7 in Action.
Views can also be animated, which is used heavily in iOS. Almost every time you transition from one view to another in an app, the current view slides out to the left while the new view slides in from the right. When a modal-style view appears, it comes in from the bottom of the screen and slides upward until it’s fully in view. When you delete an item from the Mail app, the row that contains the email you’re deleting slides out. When you delete a photo from the Photos app, the UIImageView that contains your photo gets sucked into the trashcan button. Animations can be applied as changes to properties of a particular view for a specific duration. You’ll learn more about animations in a later chapter. Next, you’ll learn about the coordinate system and how views are represented within a window.
With the Tasks application you created a basic table view that displayed a list of tasks. For your purposes, a table view was the best way to represent your data. Imagine a task application that did not arrange your tasks into a list. Hard to picture, isn’t it? On the other hand, imagine if all of the photos in your Photos app were organized into a table view with only one photo per row. You could argue that this would result in too much wasted space because you could organize your photos in a grid to maximize the space you have available.
Probably the most important method to implement is the one that is called by your table view when a row is selected or deselected. You want to be able to respond when someone taps a row within your table view. The method within the UITableViewDelegate protocol that you’d use to handle this action is tableView:didSelectRowAtIndexPath:. Let’s see what it looks like:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // Perform an action }The second parameter that’s passed in is an NSIndexPath, which lets you know the section and the row for the cell that’s been selected. In this case, this lets you know which album was selected by using the position of the row to locate the album within the albums array.
There are times when you’d want someone to be able to slide to delete a row within a table view. For instance, if you wanted a quick way to delete tasks that you’ve entered in the Tasks app you previously created, you could allow users to swipe to delete. In your Albums app, you’re only allowing users to view what they have in their assets library. If you wanted to implement deletion, you could do so by implementing a few methods in your view controller.
Let’s go ahead and implement it without actually deleting anything permanently. You’ll just be visually removing the rows and not actually deleting any photo albums that you’ve created. So don’t worry—none of the photos you have on your device will actually be removed. First, you need to enable deletion on your table view by adding one specific UITableViewDataSource method. Open Xcode, choose IAAlbumsViewController.m, and add the following method:
Within this method you’re first checking to see if the editing style is for deletion, because you know that a table view can support multiple editing styles. You’re then removing the object from your albums array and removing the row from the table view. You’re removing the object from the array because your table view will still think that there are X number of rows to display, even after your row has been deleted. Because you are returning the number of rows to display depending on the size of your albums array, you need to update your array to reflect the change.

This is an excerpt from Manning's book iPhone in Action: Introduction to Web and SDK Development.
Table 4.6. error and results give you access to SQL responses.
Property
Summary
error.code
Error code
error.message
Error text
results.rows.length
Number of rows of responses
results.rows.item(i)['name']
Result from column 'name' of row i of your response
results.rowsAffected
Number of rows affected by an UPDATE or DELETE
results.insertId
ID of last INSERT operation
Table 5.2. iUI makes about a dozen classes available for you to use in creating iPhone-like web pages.
iUI class
Element
Summary
button
<a>
The standard iPhone-UI toolbar button. Appears at top right ?normally, or at top left with an arrow pointing backward with id=”backButton”.
leftButton
<a>
Moves a button left.
blueButton
<a>
Turns a button blue.
grayButton
<a>
A page-width gray button.
This is the button to use for important links internal to your page.
whiteButton
<a>
A page-width white button.
This is the button to use for important links internal to your page.
toolbar
<div>
The core class for iUI. Anchors the page.
dialog
<form>
Creates a standard iPhone UI for data entry.
group
<li>
A nonlinked list item, intended to organize links into groups.
panel
body element
Creates a standard iPhone UI for settings.
row
body element
Creates a left- and right-justified set of data.
toggle
.row
Creates toggle buttons in a row.
That leaves us with just one missing item from our iUI color selector example: the settings page. We’ll be laying this out with our remaining iUI classes for this example: panel and row (see listing 5.7). These classes are meant to mimic the Settings page found on your iPhone, with its rows of options that you can change.