当解雇子父VC完全重载时

时间:2018-04-11 14:41:46

标签: ios swift

我有这么奇怪的问题。我有名为NewAdCreationViewController的父VC,它提供名为CollectionPicturesViewController的模态子VC。 在子VC中,我有链接到父VC。

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {

    if segue.identifier == picturesCollectionVCSegueName {

        let collectionController = (segue.destination as! UINavigationController).viewControllers.first as! CollectionPicturesViewController
        let cell = tableView.cellForRow(at: IndexPath(row: 0, section: 0)) as? PicturesCollectionTableViewCell
        guard cell != nil else{ return }
        collectionController.picturesArray = cell!.itemPictures
        collectionController.parentVC = self // this is link!
    }
}

在儿童VC中,我提出了另一个用于挑选照片的VC - DKImagePickerController(pod)。选中后我的所有照片都出现在子VC中的collectionView中,当我点击“保存”时,我想将所有数据传递给父VC并解雇孩子,

    @objc func savePictures(){
    self.parentVC.pictures = self.picturesArray
    self.parentVC.tableView.reloadData()

    self.dismiss(animated: true, completion: nil)
}

但在我解雇之后,我的父母完全重新加载并从viewDidLoad开始。它呈现了全新的VC(我在控制台中检查过,它在内存中有另一个地址)。我真的不知道为什么会这样?

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:0)

在突出显示的segue上,我已将演示文稿更改为Over full screen。它完美无需重载! enter image description here

相关问题