Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/108.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.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 Mac Catalyst-拖动到非活动窗口_Ios_Macos_Mac Catalyst - Fatal编程技术网

Ios Mac Catalyst-拖动到非活动窗口

Ios Mac Catalyst-拖动到非活动窗口,ios,macos,mac-catalyst,Ios,Macos,Mac Catalyst,通过Xcode 11b6中的Catalyst为macOS构建了一个iPad应用程序,它可以将UIImage对象作为拖动项目 当我从Finder或照片中拖动图像时,我发现我的应用程序必须首先放置在前台才能接受拖动 这很有效 我的应用前景 将图像拖到应用程序中。接受放弃 这不管用 我的应用程序背景 将图像拖到应用程序中。未触发删除处理程序,不接受删除 预期的行为是,内容可以像任何Cocoa应用程序一样拖到非活动窗口中 我正在实现UIDropInteractionDelegate extens

通过Xcode 11b6中的Catalyst为macOS构建了一个iPad应用程序,它可以将
UIImage
对象作为拖动项目

当我从Finder或照片中拖动图像时,我发现我的应用程序必须首先放置在前台才能接受拖动

这很有效

  • 我的应用前景
  • 将图像拖到应用程序中。接受放弃
这不管用

  • 我的应用程序背景
  • 将图像拖到应用程序中。未触发删除处理程序,不接受删除
预期的行为是,内容可以像任何Cocoa应用程序一样拖到非活动窗口中

我正在实现
UIDropInteractionDelegate

extension MyViewController: UIDropInteractionDelegate {

  func dropInteraction(_ interaction: UIDropInteraction, canHandle session: UIDropSession) -> Bool {
    return session.canLoadObjects(ofClass: UIImage.self)
  }

  func dropInteraction(_ interaction: UIDropInteraction, sessionDidUpdate session: UIDropSession) -> UIDropProposal {
    //only want external app sessions
    if session.localDragSession == nil {
      return UIDropProposal(operation: .copy)
    }
    return UIDropProposal(operation: .cancel)
  }

}

这是Catalyst beta版的一个怪癖还是需要一些额外的
UIWindow
/
UIScene
magic?

这似乎是Catalysta的一个bug,在最新的beta版中得到了修复。我正在运行Beta 7,这个问题不再存在