TouchViewController.m 815 B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * Copyright (c) 2015-present, Facebook, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. */
  9. #import "TouchViewController.h"
  10. @implementation TouchViewController
  11. - (void)viewDidLoad
  12. {
  13. [super viewDidLoad];
  14. self.touchable.delegate = self;
  15. self.numberOfTouchesLabel.text = @"0";
  16. self.numberOfTapsLabel.text = @"0";
  17. }
  18. - (void)shouldHandleTapsNumber:(int)numberOfTaps {
  19. self.numberOfTapsLabel.text = [NSString stringWithFormat:@"%d", numberOfTaps];
  20. }
  21. - (void)shouldHandleTouchesNumber:(int)touchesCount {
  22. self.numberOfTouchesLabel.text = [NSString stringWithFormat:@"%d", touchesCount];
  23. }
  24. @end