美文网首页
ios 使用StoryBoard界面跳转(swift,Oc)

ios 使用StoryBoard界面跳转(swift,Oc)

作者: wenju | 来源:发表于2020-08-18 11:51 被阅读0次

    eg:
    swift跳转
    let picEditViewController = UIStoryboard.init(name: "InsProjectMain", bundle: nil).instantiateViewController(withIdentifier: "PicEditViewController") as! PicEditViewController
    picEditViewController.editImage = selectedImage
    picEditViewController.modalPresentationStyle = .fullScreen
    self.present(picEditViewController, animated: true, completion:nil)
    swift返回上一级
    self.dismiss(animated: true, completion: nil)
    swift返回两级
    self.presentingViewController?.dismiss(animated: false, completion: nil)
    self.presentingViewController?.dismiss(animated: true, completion: nil)

    oc跳转
    UIStoryboard *sb =[UIStoryboard storyboardWithName:@"InsProjectMain" bundle:nil];
    ShareViewController *sahreVC = [sb instantiateViewControllerWithIdentifier:@"ShareController"];
    sahreVC.videoStr = videoPath;
    //模态弹窗全屏
    sahreVC.modalPresentationStyle = 0;
    [controller presentViewController:sahreVC animated:YES completion:nil];
    oc返回上一级
    [self dismissViewControllerAnimated:YES completion:^{}];

    相关文章

      网友评论

          本文标题:ios 使用StoryBoard界面跳转(swift,Oc)

          本文链接:https://www.haomeiwen.com/subject/iwuhjktx.html