滑动删除在 中不起作用maccatalyst。相同的代码在 iPad 上运行良好。
UITableview trailingSwipeActionsConfigurationForRowAt中未调用该方法maccatalyst。
func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool
{
if indexPath.row == RestrictedDeletionRoom
{
return false
}
else
{
return true
}
}
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
if editingStyle == .delete {
tableView.deleteRows(at: [indexPath], with: .fade)
}
}
func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
let delete = UIContextualAction(style: .destructive, title: "Delete") { (action, sourceView, completionHandler) in
self.deletedRowDict …Run Code Online (Sandbox Code Playgroud) 当通过停靠图标退出我的催化剂应用程序时(右键单击 -> 退出),我的 SceneDelegate 的stateRestorationActivity(for scene: UIScene)方法被调用,并且我返回一个非零的 NSUserActivity。
connectionOptions但是,当重新启动我的应用程序时,其中没有用户活动scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions)
对于其他人来说,这个功能是否正确?我是否需要以特定方式构建 UserActivity 才能在 Catalyst 中工作?在 iOS 上运行时可以正常运行。
另一个 Mac Catalyst 移植问题。在 iOS 中完美运行以获取用于视频目的的 AVCaptureDevice 的代码在 macOS 上运行时失败并返回 nil。
演示此问题的最简单方法是使用 Apple 自己的AvCam 演示应用程序。它在 Swift 和 Objective-C 中都有提供。两者都以同样的方式失败。选中“Mac”复选框并在 Mac 上构建和运行。授予相机权限,然后注意控制台中的错误。
在Swift版本中,查看configureSessionCameraViewController的方法。线路:
var defaultVideoDevice: AVCaptureDevice?
// Choose the back dual camera, if available, otherwise default to a wide angle camera.
if let dualCameraDevice = AVCaptureDevice.default(.builtInDualCamera, for: .video, position: .back) {
defaultVideoDevice = dualCameraDevice
} else if let backCameraDevice = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: .back) {
// If a rear dual camera is not available, default to …Run Code Online (Sandbox Code Playgroud) 我正在 iPad 应用程序的 Mac Catalyst 版本中打开多个场景。问题是所有窗口都只是在每个窗口标题中显示我的应用程序名称。这使得查看“窗口”菜单中的窗口列表变得混乱。另外,我希望特定信息出现在应用程序名称旁边的窗口标题中。
UIWindowScene 有一个很有前途的 Mac Catalyst 属性,名为titleBartype UITitleBar。听起来很有希望,但它与设置任何类型的标题无关。奇怪的。
我在UIWindowScene或UIWindow类或任何与场景相关的东西中找不到任何东西。
我也试过设置title窗口的rootViewController. 那没有效果。我还尝试了representedURL属性的各种值,UITitlebar但这些值用于更改标题以外的其他事情。
有没有办法在 Mac Catalyst 应用程序中设置窗口的标题?