简体   繁体   中英

Animated segue from xib view to ViewController

I have one view called thirdView.xib and "allPicsViewController"(so there is no Storyboard Segue). My question is, if it is possible to perform animated segue (Cross Dissolve would be the best),instead of ordinary animation which goes from the bottom.

This code shows my "allPicsViewController" and it works,but the view animates from the bottom.

func showProfileController(){  
        let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
        let vc: UIViewController = storyboard.instantiateViewControllerWithIdentifier("allPicsViewController")
        self.presentViewController(vc, animated: true, completion: nil)

        print("btn tapped")       
    }

I have also tried to set animated:false , but that was not good. Thanks.

From my comment above (to help other people):

just set

vc.modalTransitionStyle = UIModalTransitionStyle.CrossDissolve 

before you present the view controller.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM