cemolcay / SlidingContainerViewController

An android scrollable tab bar style container view controller
MIT License
217 stars 41 forks source link

Collection View :swift #16

Open ryukouiti opened 7 years ago

ryukouiti commented 7 years ago

Hi,can i add collection view ? I would be happy to hear from you .

ryukouiti commented 7 years ago

Tell me how to add collection view. I will wait for you.

cemolcay commented 7 years ago

Hi, sure you need to add in your content controller.

ryukouiti commented 7 years ago

Thank you for replaying I would be happy to help me

fatal error: unexpectedly found nil while unwrapping an Optional value

func viewControllerWithColorAndTitle (_ color: UIColor, title: String) -> UIViewController { let vc = UIViewController ()

        vc.view.addSubview(collectionView)

        return vc
    }
ryukouiti commented 7 years ago

I want to add collection view to vc1, vc2, vc3, vc4.

let slidingContainerViewController = SlidingContainerViewController ( parent: self, contentViewControllers: [vc1, vc2, vc3, vc4], titles: ["First", "Second", "Third", "Forth"])
self.view.addSubview(slidingContainerViewController.view)