Last active
December 14, 2016 08:20
-
-
Save mono0926/abd7d079361f36efdd9068b27b41ea50 to your computer and use it in GitHub Desktop.
rootViewController差し替え時のメモリリーク対策
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let previousVC = window.rootViewController | |
window.rootViewController = vc | |
// あとから閉じてるけど、先でも良いかも(要検証) | |
if let previousVC = previousVC { | |
previousVC.dismiss(animated: false) { | |
// これ不要かも(要検証) | |
previousVC.view.removeFromSuperview() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment