ビューの名前を switch ステートメントのパラメーターにすることはできますか? もしそうなら、私はスイッチで何を使用しますか?
[self addChildViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"View1"]];
[self addChildViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"View2"]];
[self addChildViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"View3"]];
[self addChildViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"View4"]];
[self addChildViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"View5"]];
[self addChildViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"View6"]];
[self addChildViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"View7"]];
[self addChildViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"View8"]];
[self addChildViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"View9"]];
[self addChildViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"View10"]];
ビュー名に応じて、ラベルに異なるテキストを表示したいと考えています。したがって、ケースがビューの名前であるスイッチが必要です。ビューの名前を返す方法がわからないので、それらをチェックできます。
ありがとう。