Tag: avfoundation presentviewcontroller

较慢的presentViewController性能

我正在使用UIViewControllerTransitioningDelegate在两个视图控制器(从MKMapView )到build立在( AVFoundation )上的自定义相机之间构build自定义转换。 一切顺利,直到我打电话给presentViewController和手机似乎挂起约1秒(当我login一切了)。 这甚至在我转换到一个更简单的视图(我有一个视图控制器只显示一个UITextview ,甚至在实际调用转换之前似乎有大约.4 – .5秒的延迟)时发生。 目前我正在调用这个过渡 dispatch_async(dispatch_get_main_queue(), ^{ UIStoryboard* sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; CameraViewController *cvc2 = [sb instantiateViewControllerWithIdentifier:@"Camera"]; cvc2.modalPresentationStyle = UIModalPresentationFullScreen; // Needed for custom animations to work cvc2.transitioningDelegate = self; //Conforms to the UIViewControllerTransitioningDelegate protocol [self presentViewController:cvc2 animated:YES completion:nil]; }); 这是我为那个调用animateTransition方法。 非常简单直观,目前只有一个MkMapView视图(没有额外的视图或方法)。 -(void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext { if (self.type == MapAnimationTypePresent) {//From […]