Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift
1.2 KB
Raw Blame
import Foundation

/// Methods beyond the original surface live in one file per area. Each area
/// returns nil for a method it does not own, so the first match answers.
extension GuestAPI {
    static func executeExtended(method: String, params: [String: Any]) throws -> [String: Any]? {
        let areas: [(String, [String: Any]) throws -> [String: Any]?] = [
            executeDevice,
            executeInput,
            executeInterface,
            executeProcess,
            executeService,
            executeLog,
            executeAppDetail,
            executeSystemApps,
            executeFileTool,
            executeStorage,
            executeEnvironment,
            executeDeviceIdentity,
            executeSetupAssistant,
            executeFirstBoot,
            executeTimeZone,
            executeClock,
            executeAudioLatency,
            executeGyroscope,
            executeAttitude,
            executeHomePodDisplay,
            executeHomePodDebug,
            executeHomeViewDistance,
            executeScript,
        ]
        for area in areas {
            if let result = try area(method, params) {
                return result
            }
        }
        return nil
    }
}