很多时候我们需要通过storyboard来拿到指定页面,下面我们看看常用的两种方法拿到storyboard。第一种比较常用,但是有些时候,在有些页面的时候。我们拿不到appdelegate。所以就需要直接拿到storyboard。通过第二种方法,通过Main拿到storyboard
+(PlayingViewController *)sharePlayingVC{
if(_vc == nil)
{
// 1
_vc = [[UIApplication sharedApplication].keyWindow.rootViewController.storyboard instantiateViewControllerWithIdentifier:@"PlayingViewController"];
// 2
_vc = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"PlayingViewController"];
}
return _vc;
}