I'm new in Swift, and now I'm trying to develop an app. I need to show UITabBarController with 3 tabs. Each tab has the same ViewController (it is custom class, inherited from UIViewController).
Sequence of my actions:
1. Put TabBarController in storyboard, dropped Tab1 and Tab2 which were situateed in it by default, and pointed a custom class (ArchiveTabBarController) and Storyboard ID (ArchiveTabBarVC).
2. Put UITableViewController in storyboard, pointed custom class (ArchiveTableViewController), and pointed storyboard ID (archiveTableVC).
3. Made a custom cell in this TableViewController: pointed a custom class (ArchiveTableViewCell), and pointed identifier (archiveTableViewCell).
4. In my ArchiveTabBarController, I wrote such code:
override func viewWillAppear(_ animated : Bool) {
super.viewWillAppear(animated);
let item1 = ArchiveTableViewController();
item1.archiveType = "";
let item2 = ArchiveTableViewController();
item2.archiveType = "type1";
let item3 = ArchiveTableViewController();
item3.archiveType = "type2";
let controllers = [item1, item2, item3];
self.viewControllers = controllers;
}
override func viewDidLoad() {
super.viewDidLoad();
delegate = self;
}
In my ArchiveTableViewController, in viewDidLoad(), I make GET-Request to load data. Result depends on archiveType.
5. In my mainMenuViewController, I made transition to the ArchiveTabBarController.
And the problem is: when I'm trying to go to the ArchiveTabBar, it fails with error: unable to deque reuasble cell with identifier "archiveTableViewCell". But when I dropped TabBar, and tried to go to the ArchiveTableViewController, it worked fine.
What is my mistake?