使用用户诺式介绍介绍viewController

技术标签: ios  迅速

我已经在其中实现了一个局部注释类。我已经在需要介绍的初始ViewController和CheckViewController之间创建了SEGUE。那是我的 didReceive responce 功能

func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { let storyboard = UIStoryboard(name: "Main", bundle: nil) let nav = storyboard.instantiateInitialViewController() as! UINavigationController let mainViewController = nav.topViewController as! ViewController mainViewController.performSegue(withIdentifier: "CheckSegue", sender: nil) }

但是我仍然得到的 - 是初始的ViewController。我在哪里错了?

看答案

MainViewController Inital View控制器?如果是这样,您看到的实例是应用程序的根。您正在创建一个不可见的全新实例。

尝试

let nav = UIApplication.shared.keyWindow?.rootViewController as? UINavigationController

代替

let nav = storyboard.instantiateInitialViewController() as! UINavigationController

智能推荐

sqlserver使用用户名和密码登录

第一步先以Windows身份验证登录。 第二步右击local选择属性。 然后在弹出的菜单中选择安全。 勾选SqlServer与Windows身份验证模式。 然后点击确定 选择安全性->登录名,在sa上右击属性 然后修改成你的密码,记住要去掉强制密码策略。 然后选择右边的状态。在登录下选择启用。 最后在local上右击重新启动即可。...

【jmeter】使用用户参数动态传参

1.右键测试计划-》线程(用户)-》线程数 2.右键线程组-》前置处理器-》用户参数 3.配置参数 参数名称为变量,调用时可以使用${变量名}表示; 每一个线程都会使用一列变量值,如果线程组超过用户数,则变量值会被循环使用 举例:线程数为3,循环次数为1,创建http请求,添加察看结果树 4.用户参数的每次迭代更新一次 如果参数值是固定的,则是否勾选,参数都没有变化; 如果参数值是动态的,如随机数...

用户画像介绍

标签分级; 标签粒度的粗细; 模型标签是核心;   第一类是人口属性,这一类标签比较稳定,一旦建立很长一段时间基本不用更新,标签体系也比较固定;第二类是兴趣属性,这类标签随时间变化很快,标签有很强的时效性,标签体系也不固定;第三类是地理属性,这一类标签的时效性跨度很大,如GPS轨迹标签需要做到实时更新,而常住地标签一般可以几个月不用更新,挖掘的方法和前面两类也大有不同,如图10-6所示。...

用户案例介绍

某台企RAC+DG容灾解决方案   案例简介: 客户需要为产线部署一套7*24小时运作的商用RAC数据库系统,目前客户单机数据库, 另外需要 B4栋做数据库灾备。确保数据安全,深思熟虑为客户提供全方位一站式系统解决方案及实施方案。 1:设备选型:服务器,存储,交换机,路由器,磁带机,防火墙等设备选择致关重要。我们从客户应用及预计用户规模上,给出全方位解决方案。 2:在...

用户画像介绍_概念

用户画像介绍(UserProfile)                         -也叫用户信息标签化,客户标签                      &nbs...

猜你喜欢

使用Object为ViewController瘦身

#本人有若干成套学习视频, 可试看! 可试看! 可试看, 重要的事情说三遍 包含Java, 数据结构与算法, iOS, 安卓, python, flutter等等, 如有需要, 联系微信tsaievan. ViewController在开发的过程中, 可能因为业务需求地增多, 变得越来越庞大, 这个时候, 我们需要为ViewController瘦身, 这时候我们可以用到一个特殊的"控件&...

分布式介绍

文章目录 一、分布式的概念 1、什么是分布式 2、分布式与==集群==的关系 3、软件架构演变 4、RPC是什么 二、分步式思想与基本概念 1、高并发 1.1 通过设计保证系统可以并行处理很多请求。应对大量==流量==与==请求== 1.2 高并发衡量指标 2、高可用 2.1 服务集群部署 2.2 数据库主从+双机热备 3、注册中心 4、负载均衡 5、服务雪崩 6、熔断 7、限流 8、API网关 ...

无意中发现看书也是一种美

2012年4月25日晚,翻翻自己喜欢的一门语言学习书(python参考手册),无意中发现书中夹着之前的明信片(有一次和同事一起去前门邓丽君音乐生活馆留下来的),感觉学习也是一种美!于是乎拍下这不经意的时刻,哈哈!...

香橙派OrangePi PC Plus开发板连接USB以太网卡测试说明

1) 目前测试过能用的 USB 以太网卡如下所示,其中 RTL8153 USB 千兆网卡插入开 发板的 USB 2.0 Host 接口中测试可以正常使用,但是速率是达不到千兆的,这点请 注意   2) 首先将 USB 网卡插入开发板的 USB 接口中,然后在 USB 网卡中插入网线,确 保网线能正常上网,如果通过 dmesg 命令可以看到下面的 log 信息,说明 USB 网卡...

计算机网络基础:Vlan,网关,dns吗,子网掩码等!面试必备!

很多朋友多次问到什么是网关、dns、子网掩码,三层交换机,它们定位的用途;确实,因为网络技术在弱电中确实应用非常广泛,我们平时在 vip 技术群中也是不断的讨论到网关、vlan、三层交换机或子网掩码等问题,今天我们就一起用通俗方式一次性了解清楚。 一、什么是 vlan? VLAN 中文是 “虚拟局域网”。LAN 可以是由少数几台家用计算机构成的网络,也可以是数以百计的计算机...

问答精选

How to extract beta coefficients for interaction effect in R?

I am examining the interaction between a continuous variable (bloodq) and a categorical variable with three levels (ER, RB, and WB). In order to see how the betas differ across tissue types, I would l...

what is the difference between Flatten() and GlobalAveragePooling2D() in keras

I want to pass the output of ConvLSTM and Conv2D to a Dense Layer in Keras, what is the difference between using global average pooling and flatten Both is working in my case. That both seem to work d...

How to invoke a test step with inputs at runtime from groovy script in SOAP UI?

I am writing a validation groovy script for a test step, intended to test a SOAP Web Service. Now, I want to call the same test step, with different input value from the groovy script. Is it possible?...

Wicket pagestore results wrong page

I have a problem with my web application with wicket. I am using wicket 6.14. I can't say exactly what the problem is, but I can describe the problem. I am using a self written pagestore, which uses h...

Unity load files from outside of resources folder

In unity is it possible to load a resource that is out side of the resources folder. I want the user to be able to set a textAsset variable from a file outside of the Assets directory entirely. You ca...

相关问题

相关文章

热门文章

推荐文章

相关标签

推荐问答