osx - Display an array of NSViewControllers horizontal in Swift -


what best way display bunch of nsviewcontrollers horizontal side side inside horizontal scrollable view?

each "row" must resizable own split view.

i tests few ideas split view , scroll view can't starting point.

thanks kick. ps.

update here i've got:

i add scrollview main view (coloumnmasterviewcontroller) border border. add second viewcontroller storyboard , named them "coloumn_view_controller"

enter image description here

in coloumnmasterviewcontroller add coloumn_view_controller.view couple of times:

class coloumnmasterviewcontroller: nsviewcontroller {  @iboutlet weak var scrollview: nsscrollview!  override func viewdidload() {     in 1...10 {         let vc: nsviewcontroller = self.storyboard?.instantiatecontrollerwithidentifier("coloumn_view_controller") as! nsviewcontroller          vc.view.setframeorigin(nspoint(x: (130 * i), y: (i * 10)))         println("set \(vc.view.bounds)")          scrollview.addsubview(vc.view)     }     scrollview.needslayout = true } } 

but scrolling not available.

enter image description here

so, how can create view inside scrollview bigger current viewport? suppose if solve this, i'm able fix other splitview problems.

thanks lot!

update 2 far:

@iboutlet weak var scrollingview: nsscrollview!  override func viewdidload() {      var contentview = nsview(frame: nsrect(x: 0, y: 0, width: 3000, height: self.view.frame.height))      contentview.wantslayer = true     contentview.layer?.backgroundcolor =  nscolor.redcolor().cgcolor      in 0...10 {         let vc: nsviewcontroller = self.storyboard?.instantiatecontrollerwithidentifier("coloumn_view_controller") as! nsviewcontroller         vc.view.setframeorigin(nspoint(x: (i * 130), y: 0))          vc.view.setframesize(nssize(width: 130, height: self.view.frame.height))         contentview.addsubview(vc.view)     }      scrollingview.documentview = contentview      autolayout(contentview) } 

enter image description here

but autolayout() didn't work well. how implement autolayout contentview pin on top, bottom, trailing , leading of superview?

you use split view controller. can have many dividers want.

in recent versions of osx view controllers can host content of other view controllers.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -