在popViewController之后未显示iOS MKMapview

时间:2019-03-13 11:23:21

标签: ios mkmapview

我正在基于地图视图开发应用程序。在每个视图控制器中,我需要显示相同的地图实例。我找到了解决问题的方法-使我的MKMapView子类成为Singleton。

    struct Static {
        static let instance = MsipMapView(frame: CGRect(x: 0, y: 0, width: 300, height: 500))
    }

    override func awakeAfter(using aDecoder: NSCoder) -> Any? {
        return Static.instance
    } 

这很好,直到我不使用popViewController方法。当我返回上一个位置时,地图视图为空白。什么会导致这种行为?

0 个答案:

没有答案