更新时间:2023-12-04 19:39:16
您可以使用ProcessInfo.processInfo.environment["XCODE_RUNNING_FOR_PREVIEWS"]
进行检测.在画布上运行时,该值将在运行时为"1"
.
You can detect this using ProcessInfo.processInfo.environment["XCODE_RUNNING_FOR_PREVIEWS"]
. The value will be "1"
at runtime when running in the canvas.