Swift 如何在webView:dragSourceActionMaskForPoint:中返回WebDragSourceAction?

Swift 如何在webView:dragSourceActionMaskForPoint:中返回WebDragSourceAction?,swift,webview,Swift,Webview,这将导致错误WebDragSourceAction无法转换为Int 我想也许我可以通过WebDragSourceAction.Any.rawValue来解决这个问题,但这也不行。我也偶然发现了这个问题。我所做的是查找Obj-C枚举并复制return中定义的值: override func webView(sender: WebView!, dragSourceActionMaskForPoint point: NSPoint) -> Int { return Web

这将导致错误
WebDragSourceAction无法转换为Int


我想也许我可以通过
WebDragSourceAction.Any.rawValue来解决这个问题,但这也不行。

我也偶然发现了这个问题。我所做的是查找Obj-C枚举并复制
return
中定义的值:

    override func webView(sender: WebView!, dragSourceActionMaskForPoint point: NSPoint) -> Int {
        return WebDragSourceAction.Any
    }
以下是这些常数的定义:

func webView(webView: WebView!, dragSourceActionMaskForPoint point: NSPoint) -> Int
{
    return 0 // for WebDragSourceAction.None
}
我知道这是一个解决办法,但我认为没有其他办法来解决它

typedef NS_OPTIONS(NSUInteger, WebDragDestinationAction) {
    WebDragDestinationActionNone    = 0,
    WebDragDestinationActionDHTML   = 1,
    WebDragDestinationActionEdit    = 2,
    WebDragDestinationActionLoad    = 4,
    WebDragDestinationActionAny     = UINT_MAX
};

typedef NS_OPTIONS(NSUInteger, WebDragSourceAction) {
    WebDragSourceActionNone         = 0,
    WebDragSourceActionDHTML        = 1,
    WebDragSourceActionImage        = 2,
    WebDragSourceActionLink         = 4,
    WebDragSourceActionSelection    = 8,
    WebDragSourceActionAny          = UINT_MAX
};