didselect viewcontroller not called swift

 Problem:

didselect viewcontroller not called swift for my tabbar view controller

Solution:

import Foundation

import UIKit


class TabBarVC:UITabBarController {

    

    override func viewDidLoad() {


    }

    override func tabBar(_ tabBar: UITabBardidSelect item: UITabBarItem) {

       if let vc = self.viewControllers?[self.selectedIndexas? MyVC {

           vc.refresh()

        }

    }


  

}


Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

store cgpoint in userdefaults iOS swift