在Info.plist中开启多任务的配置
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<true/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
</dict>
<dict>
<key>UISceneConfigurationName</key>
<string>SplitDemo</string> //自定义的配置标识
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SplitDemoDelegate</string> //自定义类
</dict>
</array>
</dict>
</dict>
创建一个新的SceneDelegate用于响应其他Scene的活动
//
// SplitSceneDelegate.swift
// Apple UI
//
// Created by eugene on 2021/6/27.
//
import SwiftUI
class SplitDemoDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UI