当前位置:网站首页>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边栏推荐
- 【线段树实战】最近的请求次数 + 区域和检索 - 数组可修改+我的日程安排表Ⅰ/Ⅲ
- Unity3d can change colors and display samples in a building GL material
- Digital chemical plants realize the coexistence of advantages of high quality, low cost and fast efficiency
- Surpassing postman, the new generation of domestic debugging tool apifox is elegant enough to use
- 接口自动化测试实践指导(中):接口测试场景有哪些
- The root file system of buildreoot prompts "depmod:applt not found"
- The most complete deployment of mongodb in history
- Intel David tuhy: the reason for the success of Intel aoten Technology
- Both primary and secondary equipment numbers are 0
- Data security -- 12 -- Analysis of privacy protection
猜你喜欢
Mongo shell, the most complete mongodb in history
Break the memory wall with CPU scheme? Learn from PayPal to expand the capacity of aoteng, and the volume of missed fraud transactions can be reduced to 1/30
SSM+JSP实现企业管理系统(OA管理系统源码+数据库+文档+PPT)
图灵诞辰110周年,智能机器预言成真了吗?
这项15年前的「超前」技术设计,让CPU在AI推理中大放光彩
DAB-DETR: DYNAMIC ANCHOR BOXES ARE BETTER QUERIES FOR DETR翻译
[written to the person who first published the paper] common problems in writing comprehensive scientific and Technological Papers
[team learning] [phase 34] Baidu PaddlePaddle AI talent Creation Camp
The root file system of buildreoot prompts "depmod:applt not found"
Have you got the same "artifact" of cross architecture development praised by various industry leaders?
随机推荐
广告归因:买量如何做价值衡量?
How to solve the problem of adding RTSP device to easycvr cluster version and prompting server ID error?
jvm是什么?jvm调优有哪些目的?
视频融合云平台EasyCVR视频广场左侧栏列表样式优化
What about the collapse of win11 playing pubg? Solution to win11 Jedi survival crash
Lecture 3 of "prime mover x cloud native positive sounding, cost reduction and efficiency enhancement lecture" - kubernetes cluster utilization improvement practice
【实践出真理】import和require的引入方式真的和网上说的一样吗
Dab-detr: dynamic anchor boxes are better queries for Detr translation
【线段树实战】最近的请求次数 + 区域和检索 - 数组可修改+我的日程安排表Ⅰ/Ⅲ
GPT-3当一作自己研究自己,已投稿,在线蹲一个同行评议
EasyCVR平台接入RTMP协议,接口调用提示获取录像错误该如何解决?
别样肉客联手德克士在全国部分门店推出别样汉堡
DAB-DETR: DYNAMIC ANCHOR BOXES ARE BETTER QUERIES FOR DETR翻译
Web3 社区中使用的术语
NTU notes 6422quiz review (1-3 sections)
数学分析_笔记_第10章:含参变量积分
[OA] excel document generator: openpyxl module
微信能开小号了,拼多多“砍一刀”被判侵权,字节VR设备出货量全球第二,今日更多大新闻在此
Up to 5million per person per year! Choose people instead of projects, focus on basic scientific research, and scientists dominate the "new cornerstone" funded by Tencent to start the application
Data security -- 12 -- Analysis of privacy protection