从记忆中清除故事板

时间:2016-03-18 15:49:23

标签: ios xcode swift

我通过按下按钮在两个故事板之间切换。

在ViewController.swift中,我切换到这样的新故事板:

@IBAction func btnSwitchStoryboard(sender: AnyObject) {
        let viewController = UIStoryboard(name: "Main2", bundle: nil).instantiateViewControllerWithIdentifier("Main2")

        self.presentViewController(viewController, animated: true, completion: nil)
    }

在Main2.swift中,我切换回另一个故事板,如:

@IBAction func btnSwitchStoryboard(sender: AnyObject) {
        let viewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("Main")

        self.presentViewController(viewController, animated: true, completion: nil)
    }

我看到通过在两个故事板之间切换来增加内存(+ 4 MB)。 有没有办法清除以前故事板的内存,或者iOS会自行清除它吗?

0 个答案:

没有答案