Advertisement
julong

hidden keyboard

May 22nd, 2014
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. //
  2. // ViewController.m
  3. //
  4. //
  5. // Created by julong on 4/3/13.
  6. // Copyright (c) 2013 julong. All rights reserved.
  7. //
  8.  
  9. #import "ViewController.h"
  10.  
  11. @interface ViewController ()
  12.  
  13. @end
  14.  
  15. @implementation ViewController
  16.  
  17. - (void)viewDidLoad
  18. {
  19. [super viewDidLoad];
  20.  
  21.  
  22. UITapGestureRecognizer *tab = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(hidesKeyboard:)];
  23. [tab setNumberOfTouchesRequired:1];
  24. [[self view] addGestureRecognizer:tab];
  25. }
  26. -(void)hidesKeyboard:(UITapGestureRecognizer *) sender{
  27. [name resignFirstResponder];
  28. [password resignFirstResponder];
  29. }
  30.  
  31. - (void)didReceiveMemoryWarning
  32. {
  33. [super didReceiveMemoryWarning];
  34. // Dispose of any resources that can be recreated.
  35. }
  36. -(void)dealloc{
  37. [name release];
  38. [password release];
  39. [super dealloc];
  40. }
  41.  
  42. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement