Abhishek Agarwal
09/06/2023, 11:31 AMAbhishek Agarwal
09/06/2023, 11:31 AMprivate val topViewController: UIViewController?
get() {
var rootController = UIApplication.sharedApplication.keyWindow?.rootViewController
while (rootController?.presentedViewController != null) {
rootController = rootController.presentedViewController
}
return rootController
}
private val noobController: UIViewController by lazy {
PreComposeApplication { NoobScreen() }
}
fun toggle() {
if(!isNoobAlreadyShowing) {
noobController.modalPresentationStyle = UIModalPresentationFullScreen
topViewController?.presentViewController(noobController, true, null)
} else {
noobController.dismissViewControllerAnimated(true, completion = null)
}
isNoobAlreadyShowing = !isNoobAlreadyShowing
}
Rafs
09/06/2023, 4:21 PMAbhishek Agarwal
09/07/2023, 4:33 AMtoggle
functionAbhishek Agarwal
09/08/2023, 10:03 AM