Dodaj UIButton jako podgląd do UITabBar

W mojej aplikacji próbuję zaimplementować ukryty UITabBar. Ustawiłem wszystkie animacje i działają bardzo dobrze. Po prostu mam problem z tym, że mój UIButton „pull-tab” pokazuje pasek kart. Nie reaguje na zdarzenie dotykowe UIControlEventTouchUpInside. Dodaję zakładkę do UITabBar w UITabBarController:

- (void)viewDidLoad
{
    [super viewDidLoad];
//Add pull
    pullButton = [UIButton buttonWithType:UIButtonTypeCustom];
    UIImage *image = [UIImage imageNamed:@"TabBarPull.png"];
    pullButton.frame = CGRectMake(self.tabBar.frame.size.width - image.size.width, -image.size.height + 3, image.size.width, image.size.height);
    [pullButton setImage:image forState:UIControlStateNormal];
    [pullButton addTarget:self action:@selector(pullBarTapped:) forControlEvents:UIControlEventTouchUpInside];
    pullButton.userInteractionEnabled = YES;
    [self.tabBar addSubview:pullButton];
}

Oto, jak wygląda pasek kart otwarty i zamknięty:

Edytuj: Ustaliłem, że problem polega na tym, że przycisk spada poza ramkę UITabBar. Wygląda na to, że będę musiał umieścić przycisk poza UITabBar ... Koszmar animacji.

questionAnswers(2)

yourAnswerToTheQuestion