我有一个文本字段,有时会从键盘上输入内容,有时会从弹出窗口上输入内容。当弹出框是输入法并且用户关闭弹出框(通过点按或选择一个值)时,我叫changed_files = ['/home/file1.txt', '/home/test/file2.cls', 'home/file3.cls', '/home/file5.cls2', '/user/bin/cls/test.txt']
[x.group(1) for i in changed_files if (x:=re.search(r'(\w+)\.cls\b',i))]
# ['file2', 'file3']
。然后弹出窗口将再次打开。
我在视图控制器上附加了一些不同的标记,这是我准备标记的一部分。
nameText.resignFirstResponder()
该部分将由if let destination = segue.destination as? ObserversPopover {
destination.delegate = self // A custom delegate for the ObserversPopover class.
destination.popoverPresentationController?.delegate = self
}
触发,但仅当我第一次关闭它时才会触发。总共,我必须选择/关闭两次弹出框。我想辞退响应者的原因是,我在屏幕上没有任何其他可编辑字段,因此用户需要能够更改其选择。如果仍然选择文本字段,则无法打开弹出窗口。
如何使弹窗仅打开一次?