prepareForSegue is not called after performSegue:withIdentifier: with popover style

前端 未结 2 1729
野趣味
野趣味 2020-12-08 18:08

I have a universal app, where I am sharing the same controller for a IPad and IPhone storyboard. I have put a UILongPressGestureRecognizer on a UITableView, that when a cell

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-08 18:26

    I've noticed that the boiler plate code for Xcode's Master-Detail template (iPhone) uses the following pattern for configuring the detail VC's view:

    1. the detail VC's setters (for properties) are overwritten in order to invoke the configureView method (configureView would update all your controls in the view, e.g., labels, etc.)
    2. the detail VC's viewDidLoad method also invokes the configureView method

    I did not follow this pattern the other day when I was trying to re-use a detail VC in my movie app, and this gave me trouble.

    I don't have much experience with popovers; however, if the pattern above is used with a detail VC that is displayed inside a popover, then wouldn't the detail VC's view get configured when you set the detail VC's properties from within the prepareForSegue method?

提交回复
热议问题