hunk.code_window: - If you are using ``LAN``, make sure your device is on the same wifi network
     as your development machine. This may not work on some public networks.
     ``localhost`` will not work for iOS unless you are in the simulator, and it
     only work on Android if your device is connected to your machine via usb.
   - Open the app on your device, then shake the device a little bit to reveal the
     developer menu. Tap on ``Debug JS Remotely``. This should open up a Chrome
     tab with the URL ``http://localhost:19001/debugger-ui``. From there, you can
     set breakpoints and interact through the JavaScript console. Shake the
  
hunk.labels: keep keep keep keep replace keep keep keep
hunk.after_edit: - Open the app on your device, then shake the device a little bit (or hit `Ctrl-Cmd-Z` on a Mac in the emulator) to reveal the
  
hunk.file_path: docs/versions/v10.0.0/guides/debugging.rst
hunk.type: replace
file: /**
   * Copyright (c) 2015-present, Facebook, Inc.
   * All rights reserved.
   *
   * This source code is licensed under the BSD-style license found in the
   * LICENSE file in the root directory of this source tree. An additional grant
   * of patent rights can be found in the PATENTS file in the same directory.
   */
  
  #import "ABI26_0_0RCTTabBarItem.h"
  
  #import "ABI26_0_0RCTConvert.h"
  #import "ABI26_0_0RCTLog.h"
  #import "UIView+ReactABI26_0_0.h"
  
  @implementation ABI26_0_0RCTConvert (UITabBarSystemItem)
  
  ABI26_0_0RCT_ENUM_CONVERTER(UITabBarSystemItem, (@{
    @"bookmarks": @(UITabBarSystemItemBookmarks),
    @"contacts": @(UITabBarSystemItemContacts),
    @"downloads": @(UITabBarSystemItemDownloads),
    @"favorites": @(UITabBarSystemItemFavorites),
    @"featured": @(UITabBarSystemItemFeatured),
    @"history": @(UITabBarSystemItemHistory),
    @"more": @(UITabBarSystemItemMore),
    @"most-recent": @(UITabBarSystemItemMostRecent),
    @"most-viewed": @(UITabBarSystemItemMostViewed),
    @"recents": @(UITabBarSystemItemRecents),
    @"search": @(UITabBarSystemItemSearch),
    @"top-rated": @(UITabBarSystemItemTopRated),
  }), NSNotFound, integerValue)
  
  @end
  
  @implementation ABI26_0_0RCTTabBarItem{
    UITapGestureRecognizer *_selectRecognizer;
  }
  
  @synthesize barItem = _barItem;
  
  - (instancetype)initWithFrame:(CGRect)frame
  {
    if ((self = [super initWithFrame:frame])) {
      _systemIcon = NSNotFound;
  #if TARGET_OS_TV
      _wasSelectedInJS = NO;
  #endif
    }
    return self;
  }
  
  - (UITabBarItem *)barItem
  {
    if (!_barItem) {
      _barItem = [UITabBarItem new];
      _systemIcon = NSNotFound;
    }
    return _barItem;
  }
  
  - (void)setTestID:(NSString *)testID
  {
    self.barItem.accessibilityIdentifier = testID;
  }
  
  - (void)setBadge:(id)badge
  {
    _badge = [badge copy];
    self.barItem.badgeValue = [badge description];
  }
  
  - (void)setSystemIcon:(UITabBarSystemItem)systemIcon
  {
    if (_systemIcon != systemIcon) {
      _systemIcon = systemIcon;
      UITabBarItem *oldItem = _barItem;
      _barItem = [[UITabBarItem alloc] initWithTabBarSystemItem:_systemIcon
                                                            tag:oldItem.tag];
      _barItem.title = oldItem.title;
      _barItem.imageInsets = oldItem.imageInsets;
      _barItem.badgeValue = oldItem.badgeValue;
    }
  }
  
  - (void)setIcon:(UIImage *)icon
  {
    _icon = icon;
    if (_icon && _systemIcon != NSNotFound) {
      _systemIcon = NSNotFound;
      UITabBarItem *oldItem = _barItem;
      _barItem = [UITabBarItem new];
      _barItem.title = oldItem.title;
      _barItem.imageInsets = oldItem.imageInsets;
      _barItem.selectedImage = oldItem.selectedImage;
      _barItem.badgeValue = oldItem.badgeValue;
    }
  
    if (_renderAsOriginal) {
      self.barItem.image = [_icon imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    } else {
      self.barItem.image = _icon;
    }
  }
  
  - (void)setSelectedIcon:(UIImage *)selectedIcon
  {
    _selectedIcon = selectedIcon;
  
    if (_renderAsOriginal) {
      self.barItem.selectedImage = [_selectedIcon imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    } else {
      self.barItem.selectedImage = _selectedIcon;
    }
  }
  
  - (void)setBadgeColor:(UIColor *)badgeColor
  {
    // badgeColor available since iOS 10
    if ([self.barItem respondsToSelector:@selector(badgeColor)]) {
      self.barItem.badgeColor = badgeColor;
    }
  }
  
  - (UIViewController *)ReactABI26_0_0ViewController
  {
    return self.superview.ReactABI26_0_0ViewController;
  }
  
  #if TARGET_OS_TV
  
  // On Apple TV, we let native control the tab bar selection after initial render
  - (void)setSelected:(BOOL)selected
  {
    if (!_wasSelectedInJS) {
      _selected = selected;
    }
  }
  
  #endif
  
  @end
  