Basically tab bar provides the default case when the image is selected. sometimes we want to change its color or image. I was looking for changing image when it is selected. but A lot of information on the web is to change color.
here are the codes who like the same as I want.
class ViewControllerUITabBar: UITabBarController, UITabBarControllerDelegate {
.
.
.
func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) {
GS.s.selectedTab = tabBarController.selectedIndex
case 2:
tabBar.selectedItem?.selectedImage = imageLiteral(resourceName: "img_message_warning")
You have to change the image in the assets to be the original image if you want the icon remains as the same image.
'3D world > Unreal Engine Games Review' 카테고리의 다른 글
브런치에서 이동 (0) | 2019.04.01 |
---|---|
우분투 18.04에서 바닐라 커널 4.17.10을 설치 (0) | 2019.03.27 |
checking logs on iphone without Xcode (0) | 2019.03.27 |
swift generic struct (0) | 2019.02.03 |
viewDidLoad()없는 뷰 제작시 사용하는 func name = entry (0) | 2019.01.27 |
최근댓글