2つのカスタムviewControllerを作成する必要があります(ストーリーボードのビューごとに1つ。例:
@interface GraphCollectionViewController : UIViewController
@interface GraphViewController : UIViewController
それらを接続するには、UIViewController包含と呼ばれるものを使用できます。
GraphCollectionViewControllerに対して、UIView用に3つのアウトレットを作成します。次に、GraphViewController(または必要な配列)の3つのプロパティを作成し、ロードされたビューでそれらを初期化します。
@property (strong, nonatomic) IBOutlet UIView *topView;
@property (strong, nonatomic) IBOutlet UIView *middleView;
@property (strong, nonatomic) IBOutlet UIView *bottomView;
@property (strong, nonatomic) GraphViewController *topGraphViewController;
@property (strong, nonatomic) GraphViewController *middleGraphViewController;
@property (strong, nonatomic) GraphViewController *bottomGraphViewController;
...
//top graph
self.topGraphViewController = [storyboard instantiateViewControllerWithIdentifier:@"GraphViewController"]; //init with view from storyboard
self.topGraphViewController.view.frame = self.topView.bounds; //set frame the same
[self.view addSubview:self.topGraphViewController.view];
[self addChildViewController:self.topGraphViewController];
[self.topGraphViewController didMoveToParentViewController:self];
//middle graph
self.middleGraphViewController = [storyboard instantiateViewControllerWithIdentifier:@"GraphViewController"]; //init with view from storyboard
self.middleGraphViewController.view.frame = self.middleView.bounds; //set frame the same
[self.view addSubview:self.middleGraphViewController.view];
[self addChildViewController:self.middleGraphViewController];
[self.middleGraphViewController didMoveToParentViewController:self];
//bottom graph
self.bottomGraphViewController = [storyboard instantiateViewControllerWithIdentifier:@"GraphViewController"]; //init with view from storyboard
self.bottomGraphViewController.view.frame = self.bottomView.bounds; //set frame the same
[self.view addSubview:self.bottomGraphViewController.view];
[self addChildViewController:self.bottomGraphViewController];
[self.bottomGraphViewController didMoveToParentViewController:self];
私はあなたがポイントを得ると思います。この例をより深く理解するために。