2
votes

I am trying to display a QLpreviewcontroller on a UIVIewcontroller.

-(void)showPreview{

   if(!_previewController){
        _previewController = [[QLPreviewController alloc] init];
        _previewController.dataSource = self;
        _previewController.delegate = self;
    }

    // There will always be one item here
    _previewController.currentPreviewItemIndex = 0;

    [_previewController setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
    [self presentViewController:_previewController animated:YES completion:nil];
}

the previecontroller is displayed but the transition is not animated. it just appears without any animation.

How are you calling this method? Is it possible that you're not calling it from the main thread?jrushing
its a method called via IBAction. If this method is called via any other thread it won't display Previewcontroller at all.Kunal Balani
Is there is something else you are doing like showing or dismissing alert/actionsheet or hiding or showing keyboard.JiteshW