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

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift