当前位置:网站首页>Detect when a tab bar item is pressed
Detect when a tab bar item is pressed
2022-07-07 04:34:00 【Zafo】
problem :
I have a root view controller which isn't set as the custom class for any of my view controllers on my storyboard. I have a root view controller , It is not set as a custom class for any view controller on my storyboard .Instead, all of my view controllers are subclassing this class like so. contrary , All my view controllers class this class like this .
// RootViewControllerclass RootViewController: UIViewController, UITabBarDelegate { // This is not getting executed on any of the view controllers func tabBar(tabBar: UITabBar, didSelectItem item: UITabBarItem) { print("ddd") }}// Subclassing it class TopStoriesViewController: RootViewController {}
But I seem to be struggling with doing something when a tabbaritem is pressed on the view controller which is subclassing the rootviewcontroller, ie, the message is not being printed. however , When inheriting rootviewcontroller Press tabbaritem when , I seem to be trying to do something , That is, no message is printed .
Solution :
Reference resources : https://stackoom.com/en/question/2Hyfj边栏推荐
- UltraEdit-32 warm prompt: right association, cancel bak file [easy to understand]
- MySQL null value processing and value replacement
- The most complete deployment of mongodb in history
- Case reward: Intel brings many partners to promote the innovation and development of multi domain AI industry
- On the 110th anniversary of Turing's birth, has the prediction of intelligent machine come true?
- 一图看懂!为什么学校教了你Coding但还是不会的原因...
- Digital chemical plant management system based on Virtual Simulation Technology
- What if the win11 screenshot key cannot be used? Solution to the failure of win11 screenshot key
- How do test / development programmers get promoted? From nothing, from thin to thick
- Poor math students who once dropped out of school won the fields award this year
猜你喜欢
Win11截图键无法使用怎么办?Win11截图键无法使用的解决方法
[team learning] [34 sessions] Alibaba cloud Tianchi online programming training camp
测试/开发程序员怎么升职?从无到有,从薄变厚.......
[OA] excel document generator: openpyxl module
[system management] clear the icon cache of deleted programs in the taskbar
Win11控制面板快捷键 Win11打开控制面板的多种方法
Network Security Learning - Information Collection
How do test / development programmers get promoted? From nothing, from thin to thick
英特尔与信步科技共同打造机器视觉开发套件,协力推动工业智能化转型
数学分析_笔记_第10章:含参变量积分
随机推荐
MySQL split method usage
VM virtual machine operating system not found and NTLDR is missing
NTU notes 6422quiz review (1-3 sections)
Ssm+jsp realizes the warehouse management system, and the interface is called an elegant interface
2022 middle school Youth Cup mathematical modeling question B fertility policy research ideas under the background of open three children
【ArcGIS教程】专题图制作-人口密度分布图——人口密度分析
Acl2022 | decomposed meta learning small sample named entity recognition
Have you got the same "artifact" of cross architecture development praised by various industry leaders?
leetcode 53. Maximum subarray maximum subarray sum (medium)
EasyCVR集群版本添加RTSP设备提示服务器ID错误,该如何解决?
各路行业大佬称赞的跨架构开发“神器”,你get同款了吗?
Mathematical analysis_ Notes_ Chapter 10: integral with parameters
Win11控制面板快捷键 Win11打开控制面板的多种方法
Deeply cultivate the developer ecosystem, accelerate the innovation and development of AI industry, and Intel brings many partners together
见到小叶栀子
Unity3d can change colors and display samples in a building GL material
主设备号和次设备号均为0
[ArcGIS tutorial] thematic map production - population density distribution map - population density analysis
Optimization of channel status offline of other server devices caused by easycvr cluster restart
Station B boss used my world to create convolutional neural network, Lecun forwarding! Burst the liver for 6 months, playing more than one million