Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use the Detail Disclosure button?

I'm new to Xcode and I need to know how to use the Detail Disclosure button that I have added to my table. The round blue arrow button when pressed will redirect the user to another ViewController, and in that ViewController, the data in the selected row will be displayed. I'll be using it for updating purposes. I'm apologize for my lack of knowledge about iOS programming. Please be patient with me. Thanks! :)

like image 712
Lorenz de Guzman Avatar asked Jan 28 '13 02:01

Lorenz de Guzman


People also ask

What is a disclosure button?

Disclosure buttons A disclosure button points down when its content is hidden and up when its content is visible. Clicking or tapping the disclosure button switches between these two states, and the view expands or collapses accordingly to accommodate the content.

What is the disclosure triangle on a Mac?

It sounds like a John Grisham novel, but it's actually part of the Graphical User Interface found in many applications on the Mac including Mail, iTunes and the Finder. It looks like this ▶ and is used to show or hide hierarchical information.


2 Answers

The correct tableView delegate method is :

-(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath

-Basically the detail disclosure button is useful for displaying some extra info in your tableView other than the main info that is invoked when the user selects the row (i.e. the didSelectRowAtIndexPath method)

like image 144
Tommy Devoy Avatar answered Nov 15 '22 14:11

Tommy Devoy


Delegate Method In Swift 3.0

func tableView(_ tableView: UITableView, accessoryButtonTappedForRowWith indexPath: IndexPath) {

}

But for Use this delegate : you can use either of following two accessory Type :

cell.accessoryType = .detailDisclosureButton
cell.accessoryType = .detailButton
like image 26
Ketan P Avatar answered Nov 15 '22 15:11

Ketan P