Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading large numbers of tab (around 50) #594

Open
maasim94 opened this issue Jan 31, 2022 · 0 comments
Open

Loading large numbers of tab (around 50) #594

maasim94 opened this issue Jan 31, 2022 · 0 comments

Comments

@maasim94
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant