Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UIAlertAction处理程序是非转义的?_Ios_Swift_Lambda_Uialertaction - Fatal编程技术网

Ios UIAlertAction处理程序是非转义的?

Ios UIAlertAction处理程序是非转义的?,ios,swift,lambda,uialertaction,Ios,Swift,Lambda,Uialertaction,我只想确认UIAlertAction的处理程序是一个非转义lambda函数 我在按住ctrl键的同时单击鼠标右键并查找UIAlertAction定义,默认情况下它看起来不像是转义。这意味着我应该这么做 weak var wself = self 在所有UIAlertAction完成块中使用wself而不是self 在UIKit>UIAlertController下,我看到了 open class UIAlertAction : NSObject, NSCopying { public c

我只想确认UIAlertAction的处理程序是一个非转义lambda函数

我在按住ctrl键的同时单击鼠标右键并查找UIAlertAction定义,默认情况下它看起来不像是转义。这意味着我应该这么做

weak var wself = self 
在所有UIAlertAction完成块中使用wself而不是self

在UIKit>UIAlertController下,我看到了

open class UIAlertAction : NSObject, NSCopying {


public convenience init(title: String?, style: UIAlertAction.Style, handler: ((UIAlertAction) -> Void)? = nil)

其中处理程序未显示@escaping

UIAlertAction处理程序为escaping


因为可选闭包都是隐式转义的(多亏了@sweeper)

它是一个转义闭包。我不知道为什么你不能从定义上看出来。可能是因为它来自Objective-C。可选闭包都隐式转义。见“谢谢你”清扫者。如果你想把这个作为答案,我会接受的。