I have a parent UIView with a number of subviews. Periodically I need to remove a subview and completely remove it from the system. What is the correct way to do this? I tried t
override func viewWillAppear(_ animated: Bool)
{
super.viewWillAppear(animated)
if let topController = UIApplication.topViewController() {
if topController.isKind(of: ProviderHome.self)
{
let arrOfSuview = self.view.subviews
if arrOfSuview.count > 1
{
print("Davender Arr of subviews : \(arrOfSuview)")
for i in 0.. 1
{
print("Davender Arr of subviews : \(arrOfSuview)")
for i in 0..
let d = dict["data"] as! Dictionary
let action = d["gcm.notification.label"] as! String
print("current message id :- ", action)
self.getNotificationId = action
if getNotificationId != ""
{
//call the api for getting Data
AppDelegate.sharedInstance().myCurrentnotificationId = getNotificationId
//working code
let storyboard = UIStoryboard(name: "Provider", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "CommonPopUpsVC") as! CommonPopUpsVC
vc.modalPresentationStyle = .overFullScreen
vc.view.frame = self.view.frame
vc.view.tag = 101
self.view.addSubview(vc.view)
self.present(vc, animated: true, completion: nil)
}
}
}