今天尝试使用swift编写一个弹框控件,结果发现iOS13中的keyWindow这个属性提示小黄点,点开一看

一想,iOS13更新这么久了,网上大神一定有各种demo了吧,兴高采烈的去网上搜索,往往看到得都是这样的文章

或者是这样

作为码农的搬运工,我直接复制一份,拿来就用,谁能想到啊,各位大神的方法居然失灵了,不应该吧!一定是我的姿势不对,左看右看上看下看,没问题啊,来打印一下window,看看是个什么鬼
没办法去看看官方文档吧,看看这个windows是个什么鬼啊

这个地方还终点描述了一下the last window,将上边的代码改改,看看last如何

还真是出来了啊,看来啊,不是first是last啊。其实仔细翻译一下,那段话,我们也不难发现,确实应该用的是last,看来啊,有的东西自己不整一遍还真是发现不了啊,我其实对我这样用last也没有完全的信心,最起码显示出来了啊。
网友评论