Show multiple data, after swipe in tableview cell
up vote
0
down vote
favorite
I am having a table view with some datas. While on left swipe of cell i want 'Delete' and 'Edit'. I got 'Delete' by using the below code. Please help me to solve this..
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
return NO;
}
return YES;
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
[self.circleGroupArray removeObjectAtIndex:indexPath.row];
[_myCircleTableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
}
ios objective-c
add a comment |
up vote
0
down vote
favorite
I am having a table view with some datas. While on left swipe of cell i want 'Delete' and 'Edit'. I got 'Delete' by using the below code. Please help me to solve this..
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
return NO;
}
return YES;
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
[self.circleGroupArray removeObjectAtIndex:indexPath.row];
[_myCircleTableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
}
ios objective-c
With default methods, it won't be available, you can go with library like : github.com/MortimerGoro/MGSwipeTableCell
– Viral Savaj
yesterday
okay thank you.
– sruthy
yesterday
Possible duplicate of Custom edit view in UITableViewCell while swipe left. Objective-C or Swift
– Teja Nandamuri
yesterday
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am having a table view with some datas. While on left swipe of cell i want 'Delete' and 'Edit'. I got 'Delete' by using the below code. Please help me to solve this..
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
return NO;
}
return YES;
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
[self.circleGroupArray removeObjectAtIndex:indexPath.row];
[_myCircleTableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
}
ios objective-c
I am having a table view with some datas. While on left swipe of cell i want 'Delete' and 'Edit'. I got 'Delete' by using the below code. Please help me to solve this..
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
return NO;
}
return YES;
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
[self.circleGroupArray removeObjectAtIndex:indexPath.row];
[_myCircleTableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
}
ios objective-c
ios objective-c
asked yesterday
sruthy
84
84
With default methods, it won't be available, you can go with library like : github.com/MortimerGoro/MGSwipeTableCell
– Viral Savaj
yesterday
okay thank you.
– sruthy
yesterday
Possible duplicate of Custom edit view in UITableViewCell while swipe left. Objective-C or Swift
– Teja Nandamuri
yesterday
add a comment |
With default methods, it won't be available, you can go with library like : github.com/MortimerGoro/MGSwipeTableCell
– Viral Savaj
yesterday
okay thank you.
– sruthy
yesterday
Possible duplicate of Custom edit view in UITableViewCell while swipe left. Objective-C or Swift
– Teja Nandamuri
yesterday
With default methods, it won't be available, you can go with library like : github.com/MortimerGoro/MGSwipeTableCell
– Viral Savaj
yesterday
With default methods, it won't be available, you can go with library like : github.com/MortimerGoro/MGSwipeTableCell
– Viral Savaj
yesterday
okay thank you.
– sruthy
yesterday
okay thank you.
– sruthy
yesterday
Possible duplicate of Custom edit view in UITableViewCell while swipe left. Objective-C or Swift
– Teja Nandamuri
yesterday
Possible duplicate of Custom edit view in UITableViewCell while swipe left. Objective-C or Swift
– Teja Nandamuri
yesterday
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Use this method in your class, If you want more actions you can create more UITableViewRowActions and add them to array.
-(NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewRowAction *editAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"Clona" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
//add edit action here
}];
editAction.backgroundColor = [UIColor blueColor];
UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
//add delete action here
}];
deleteAction.backgroundColor = [UIColor redColor];
return @[deleteAction,editAction];
}
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Use this method in your class, If you want more actions you can create more UITableViewRowActions and add them to array.
-(NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewRowAction *editAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"Clona" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
//add edit action here
}];
editAction.backgroundColor = [UIColor blueColor];
UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
//add delete action here
}];
deleteAction.backgroundColor = [UIColor redColor];
return @[deleteAction,editAction];
}
add a comment |
up vote
0
down vote
Use this method in your class, If you want more actions you can create more UITableViewRowActions and add them to array.
-(NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewRowAction *editAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"Clona" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
//add edit action here
}];
editAction.backgroundColor = [UIColor blueColor];
UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
//add delete action here
}];
deleteAction.backgroundColor = [UIColor redColor];
return @[deleteAction,editAction];
}
add a comment |
up vote
0
down vote
up vote
0
down vote
Use this method in your class, If you want more actions you can create more UITableViewRowActions and add them to array.
-(NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewRowAction *editAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"Clona" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
//add edit action here
}];
editAction.backgroundColor = [UIColor blueColor];
UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
//add delete action here
}];
deleteAction.backgroundColor = [UIColor redColor];
return @[deleteAction,editAction];
}
Use this method in your class, If you want more actions you can create more UITableViewRowActions and add them to array.
-(NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewRowAction *editAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"Clona" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
//add edit action here
}];
editAction.backgroundColor = [UIColor blueColor];
UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
//add delete action here
}];
deleteAction.backgroundColor = [UIColor redColor];
return @[deleteAction,editAction];
}
answered yesterday
Dinesh Gurrapu
10511
10511
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53409131%2fshow-multiple-data-after-swipe-in-tableview-cell%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
With default methods, it won't be available, you can go with library like : github.com/MortimerGoro/MGSwipeTableCell
– Viral Savaj
yesterday
okay thank you.
– sruthy
yesterday
Possible duplicate of Custom edit view in UITableViewCell while swipe left. Objective-C or Swift
– Teja Nandamuri
yesterday