FLEXKeyboardHelpViewController.m 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // FLEXKeyboardHelpViewController.m
  3. // FLEX
  4. //
  5. // Created by Ryan Olson on 9/19/15.
  6. // Copyright © 2015 f. All rights reserved.
  7. //
  8. #import "FLEXKeyboardHelpViewController.h"
  9. #import "FLEXKeyboardShortcutManager.h"
  10. #import "KBSelectableTextView.h"
  11. @interface FLEXKeyboardHelpViewController ()
  12. #if TARGET_OS_TV
  13. @property (nonatomic) KBSelectableTextView *textView;
  14. #else
  15. @property (nonatomic) UITextView *textView;
  16. #endif
  17. @end
  18. @implementation FLEXKeyboardHelpViewController
  19. - (void)viewDidLoad {
  20. [super viewDidLoad];
  21. #if TARGET_OS_TV
  22. self.textView = [[KBSelectableTextView alloc] initWithFrame:self.view.bounds];
  23. #else
  24. self.textView = [[UITextView alloc] initWithFrame:self.view.bounds];
  25. #endif
  26. self.textView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
  27. [self.view addSubview:self.textView];
  28. #if TARGET_OS_SIMULATOR
  29. self.textView.text = FLEXKeyboardShortcutManager.sharedManager.keyboardShortcutsDescription;
  30. #endif
  31. self.textView.backgroundColor = UIColor.blackColor;
  32. self.textView.textColor = UIColor.whiteColor;
  33. self.textView.font = [UIFont boldSystemFontOfSize:14.0];
  34. #if !TARGET_OS_TV
  35. self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
  36. #endif
  37. self.title = @"Simulator Shortcuts";
  38. self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(donePressed:)];
  39. }
  40. - (void)donePressed:(id)sender {
  41. [self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
  42. }
  43. @end