I am on ChatViewController
and i navigated to some other page and again i visited to ChatViewController
so how can i check i m on ChatViewController
page or not when i visit same page.
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(true)
UserDefaults.standard.value(forKey: "ChatView")
print("view will appear called")
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(true)
UserDefaults.standard.object(forKey: "ChatView")
print("view will disappear called")
}
Do i need to set any UserDefaults
value or some other thing.Could some one help me in this.Thanks in advance