SplitKit icon indicating copy to clipboard operation
SplitKit copied to clipboard

View resize issue

Open nhjariwala opened this issue 8 years ago • 0 comments

First thanks a lot for the amazing library. I have spent more than 4 days to get similar concept in my application. What I need to do was I have two UIView that needs to be resize runtime by end user. Using SplitKit I was implemented demo project and it works fine. But my actual requirement was: I have two UICollectionView that Arrangement was vertically. But when I changed height of UICollectionView it was not resize the UICollectionView Please have look my code

    let splitController: SplitViewController = SplitViewController()
    splitController.separatorColor = UIColor.gray
    splitController.separatorSelectedColor = UIColor(red: 247/255, green: 162/255, blue: 57/255, alpha: 1)
    
    self.addChildViewController(splitController)
    splitController.view.frame = self.view.bounds
    splitController.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
    self.view.addSubview(splitController.view)
    splitController.didMove(toParentViewController: self)
    splitController.arrangement = Arrangement.vertical

    let tempController1: UIViewController = UIViewController()
    let flowLayout = UICollectionViewFlowLayout()
    
    let collectionView = UICollectionView(frame: self.view.bounds, collectionViewLayout: flowLayout)
    collectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "collectionCell")
    collectionView.delegate = self
    collectionView.dataSource = self
    collectionView.backgroundColor = UIColor.cyan
    tempController1.view.addSubview(collectionView)
    
    let tempController2: UIViewController = UIViewController()
    tempController2.view.backgroundColor = UIColor.red
    
    splitController.firstChild = tempController1
    splitController.secondChild = tempController2

What I need to implement is when separator's position change both UICollectionView height should be resize.

Thanks a lot. Waiting for your response.

nhjariwala avatar Dec 26 '17 12:12 nhjariwala