Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
  2.  
  3. UITouch *touch = [touches anyObject];
  4.  
  5. NSUInteger tapCount = [touch tapCount];
  6.  
  7. switch (tapCount) {
  8. case 1:
  9. [self performSelector:@selector(singleTapMethod) withObject:nil afterDelay:.4];
  10. break;
  11. case 2:
  12. [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(singleTapMethod) object:nil];
  13. [self performSelector:@selector(doubleTapMethod) withObject:nil afterDelay:.4];
  14. break;
  15. . . .
  16. }
  17.  
  18. -(IBAction)buttonClick
  19. {
  20. //setup ur view dynamically as you like//
  21. PSview=[[UIView alloc]initWithFrame:CGRectMake(5, 5, 310,450)];
  22. PSview.backgroundColor=[UIColor blackColor];
  23. PSview.alpha=0.8;
  24. [PSview.layer setBorderColor: [[UIColor whiteColor] CGColor]];
  25. [PSview.layer setBorderWidth: 3.0];
  26.  
  27.  
  28. PSview.contentMode=UIViewContentModeScaleAspectFill;
  29. PSview.clipsToBounds=YES;
  30. [PSview.layer setBorderColor: [[UIColor whiteColor] CGColor]];
  31. [PSview.layer setBorderWidth: 3.0];
  32.  
  33. [PSview addSubview:subView];
  34. [self.view addSubview:PSview];
  35.  
  36. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  37. {
  38. //since there are two tables in one view, you can differentiate them using if()
  39. if(tableView==subView)
  40. {
  41. // ...ur code . ..
  42. // write your code what needs to happen when you click a row of your subView.
  43. [PSview removeFromSuperview];
  44. }
  45. if(tableView==mainView)
  46. {
  47. // write your code , what happens when user clicks row of the main table
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement