Guest User

Untitled

a guest
Jun 19th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. - (NSIndexPath *)tableView:(UITableView *)tv willSelectRowAtIndexPath:(NSIndexPath *)path
  2. {
  3. // Determine if row is selectable based on the NSIndexPath.
  4.  
  5. if (rowIsSelectable)
  6. {
  7. return path;
  8. }
  9.  
  10. return nil;
  11. }
  12.  
  13. [tableView deselectRowAtIndexPath:[tableView indexPathForSelectedRow] animated:NO];
  14.  
  15. - (void)setSelectable:(BOOL)enabled {
  16. [self setSelectionStyle:UITableViewCellSelectionStyleNone];
  17. [self setUserInteractionEnabled:enabled];
  18. }
  19.  
  20. - (BOOL)isSelectable {
  21. BOOL disabled = [self selectionStyle]==UITableViewCellSelectionStyleNone &&
  22. [self isUserInteractionEnabled];
  23. return ! disabled;
  24. }
  25.  
  26. self.myTableView.allowsSelection = NO;
Add Comment
Please, Sign In to add comment