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.
'HJH IT Logs' 카테고리의 다른 글
fastapi test codes. (0) | 2019.03.28 |
---|---|
우분투 18.04에서 바닐라 커널 4.17.10을 설치 (0) | 2019.03.27 |
checking logs on iphone without Xcode (0) | 2019.03.27 |
동적템플릿 (0) | 2019.03.26 |
440억 들였는데…줄줄이 문 닫고 간판까지 내렸다 (0) | 2019.03.26 |
최근댓글