GithubHelp home page GithubHelp logo

Comments (5)

h36ahmedUW avatar h36ahmedUW commented on May 15, 2024 1

`override func viewDidLoad() {
super.viewDidLoad()

    let tc = TabPageViewController.create()
    let vc1 = UIViewController()
    vc1.view.backgroundColor = UIColor(red: 251/255, green: 252/255, blue: 149/255, alpha: 1.0)
    let vc2 = UIViewController()
    vc2.view.backgroundColor = UIColor(red: 252/255, green: 150/255, blue: 149/255, alpha: 1.0)
    let vc3 = UIViewController()
    vc3.view.backgroundColor = UIColor(red: 149/255, green: 218/255, blue: 252/255, alpha: 1.0)
    let vc4 = UIViewController()
    vc4.view.backgroundColor = UIColor(red: 149/255, green: 252/255, blue: 197/255, alpha: 1.0)
    let vc5 = UIViewController()
    vc5.view.backgroundColor = UIColor(red: 252/255, green: 182/255, blue: 106/255, alpha: 1.0)
    tc.tabItems = [(vc1, "Mon."), (vc2, "Tue."), (vc3, "Wed."), (vc4, "Thu."), (vc5, "Fri.")]
    var option = TabPageOption()
    //option.tabWidth = view.frame.width / CGFloat(tc.tabItems.count)
    tc.option = option
    
    self.addChildViewController(tc)
    
    self.view.addSubview(tc.view)
    
    // Configure Child View
    tc.view.frame = view.bounds
    tc.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
    
    // Notify Child View Controller
    tc.didMove(toParentViewController: self)
    // Do any additional setup after loading the view.
}`

To add to any custom view controller, first create a container view in custom view controller and then create a controller for that container and place the code as you see in the controller for that container. It should work like a CHARM!

from tabpageviewcontroller.

dp4dileep avatar dp4dileep commented on May 15, 2024

same problem

from tabpageviewcontroller.

EndouMari avatar EndouMari commented on May 15, 2024

Do you want to use the TabPageViewController to the RootViewController?

from tabpageviewcontroller.

janaraj avatar janaraj commented on May 15, 2024

Same problem, yes would it be possible to add it as RootviewController

from tabpageviewcontroller.

3bdelsalam avatar 3bdelsalam commented on May 15, 2024

@ghass64 @dp4dileep @janaraj
i faced same problem and i wanted to show it as RootviewController
after some tries i solved it
by using addChildViewController not pushViewController
((
navigationController?.addChildViewController(tabPageViewController)
))

from tabpageviewcontroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.