Skip to content

Loading large numbers of tab (around 50) #594

@maasim94

Description

@maasim94

I have searched in existing issues but could not find any solution.

I have situations where i need to create multiple webview which i'm handling through tabman. problem is it is taking too much time to load and app kind of stuck for some seconds.

Implementation is really straightforward and according to docs.

class TabViewController: TabmanViewController {
         override func viewDidLoad() {
        super.viewDidLoad()
        
        self.dataSource = self
        
        let bar = TMBarView<TMConstrainedHorizontalBarLayout, TMTabItemBarButton, TMLineBarIndicator>()
        bar.buttons.customize {
            
            $0.tintColor = Asset.lightBlue.color
            $0.selectedTintColor = Asset.darkSkyBlue.color
            $0.font = FontFamily.MyriadPro.bold.font(size: 14)
            $0.adjustsFontForContentSizeCategory = true
            
        }
        
        bar.spacing = 16
        bar.fadesContentEdges = false
        bar.layout.transitionStyle = .snap // Customize 
        let systembar = bar.systemBar()
        systembar.backgroundStyle = .flat(color: UIColor.white)
        
        self.addBar(systembar,
                    dataSource: self,
                    at: .top)
        self.loadSelectedWebsites()
    }

    func loadData() {
       for selectedWebsite in self.selectedWebsites {
            let webController = StoryboardScene.Main.webViewController.instantiate()
            webController.delegate = self
            webController.websiteURL = selectedWebsite.url
            self.viewControllers.append(webController)
        }
        self.reloadData()
    }
}

and class conforms to datasource delegates of Tabman

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions