1

In my app I should use a several Tab Bar Item with one Controller. To approach this in my Second and Third Tab Bar Item Controllers I use self.tabBarController?.selectedIndex = 0. As you can see this solution generates blink effect...

enter image description here

It's happens every time when I choose Third Tab Bar Item.

How to get rid of this blink?

Any help is greatly appreciated!

Roman Romanenko
  • 736
  • 9
  • 24
  • Please post where exactly you have put that line and also post viewDidAppears, viewWillAppears, viewDidLoads if something related is in. I would track some print()s in these methods so it woúd be better visible why or when are some certain methods skipped/ passed – pedrouan Sep 14 '16 at 13:05
  • I added it in viewWillAppear and viewDidAppear. Also I tried put that line in viewDidLoad, but it's nothing to change – Roman Romanenko Sep 14 '16 at 14:36
  • How is that possible to have both items (first and third) active at the same time? – pedrouan Sep 14 '16 at 14:50
  • I just change the item at third item. Indeed Only active first item. – Roman Romanenko Sep 14 '16 at 14:53
  • I know but as I see two tabs are blue. It is supposed to be only one tab marked active. Or I dont understand that animation, it looks confusing while it is repeating so many times. You could better describe those events- steps by step- like "click on the tab, 1 sec. waiting, then ... " etc. – pedrouan Sep 14 '16 at 14:56
  • In the design of this situation that two tab bar items must be marked. I should searching in first tab. And when I select third, I do this. And in the same time I show that user chose search option. Is it clear for you now? – Roman Romanenko Sep 14 '16 at 15:03
  • Is home view controller containing that search bar originally? What I was thinking until know, was, that you only redirect a user by tapping third tab and that third controller puts you back to home view controller. Then, in your third VC should be nothing except of redirect statement ... = 0 – pedrouan Sep 14 '16 at 15:10
  • Yes, you are right! Home view controller containing search bar. When user tapped third I show search bar. – Roman Romanenko Sep 14 '16 at 15:20
  • So I would expect this if set properly: You tap third tab. Third bar will be blue (and the first one will be gray though) just the moment it is being redirected. Then it will show the first Vc and the only blue tab will be the first one with the home icon. Is it like that? When I investigate such situations, I used to switch slow animations mode on (in simulator's main menu). Then it can be easier to find out possible issues. This looks like the first/third view controller dealloc itself from the memory in some occasions. – pedrouan Sep 14 '16 at 16:39
  • 'Is it like that?' Yes, it is. I just to track when was redirect, and light third tab in blue color. I think that view is blinking because third tab has own VC ("SearchViewController") which set up when app is opening. When user chose search tab at first showing "SearchViewController" then happens redirect and then showing "HomeViewController". So question is: how to avoid showing "SearchViewController" at first time? – Roman Romanenko Sep 15 '16 at 07:18
  • **slow animations mode** not working for this case. But in general (like transition between scenes) working well. – Roman Romanenko Sep 15 '16 at 07:24
  • What about to skip that third view controller in this manner: Delete the segue from tabbar controller to third VC and make another segue to the first view controller. You may get new fictive tab that is directing to home either. I haven't tried this option yet. – pedrouan Sep 15 '16 at 08:56
  • Thank you, that you answer me still! I check this and write feedback here. – Roman Romanenko Sep 15 '16 at 10:57
  • Did you ever resolve this issue? – Yarm Nov 09 '19 at 04:41

0 Answers0