I am trying to work with a social network framework (CometChat) which is either embedding a Storyboard or Tabbar controller on my UIApplication Window. Now i need a way to dismiss the embedded view when i am done interacting with it. I added a button to the window to call below method to dismiss the embedded
func dismiss() {
let rootvc = UIApplication.shared.keyWindow?.rootViewController
for v in (rootvc?.view.subviews)! {
v.isHidden = true
}
}
Every view behind the embedded view seems to disappear, but not the embedded view.Screenshot of calling above method
Tried looping through all windows and hiding views in windows, still no luck
let windows = UIApplication.shared.windows
for window in windows {
window.rootViewController?.view.isHidden = true
}
Please Help, i have been on this for about 4 days now.. Thanks in advance.