Instance Method インスタンスメソッド

handlesExternalEvents(preferring:allowing:)

Specifies a modifier indicating the Scene this View is in can handle matching incoming External Events. このViewが中に入っているSceneは合致しているやってくるExternal Eventそれらを取り扱い可能であると指し示しているある修飾子を指定します。

Declaration 宣言

func handlesExternalEvents(preferring: Set<String>, allowing: Set<String>) -> some View

Parameters パラメータ

preferring

A Set of Strings that are checked to see if they are contained in the targetContentIdenfifier to see if the Scene this View is in prefers to handle the Exernal Event. The empty Set and empty Strings never match. The String value “*” always matches. The String comparisons are case/diacritic insensitive StringいくつかからなるあるSet、それらは点検されて、それらがtargetContentIdenfifierの中に含まれるかどうか見ることで、このViewが入っているSceneがExernal Eventを取り扱うほうを好むかどうか見ることになります。空のSetと空のStringは決して合致しません。String値 “*” は常に合致します。String比較は、ケース/区別的発音符を考慮しません。

allowing

A Set of Strings that are checked to see if they are contained in the targetContentIdenfifier to see if the Scene this View is in allows handling the External Event. The empty Set and empty Strings never match. The String value “*” always matches. StringいくつかからなるあるSet、それらは点検されて、それらがtargetContentIdenfifierの中に含まれるかどうか見ることで、このViewが入っているSceneがExernal Eventの取り扱いを許可するかどうか見ることになります。空のSetと空のStringは決して合致しません。String値 “*” は常に合致します。

Discussion 議論

If no modifier is set in any Views within a Scene, the behavior is platform dependent. On macOS, a new Scene will be created to use for the External Event. On iOS, the system will choose an existing Scene to use. 修飾子があるScene内のどのビューにおいても設定されないならば、挙動はプラットホーム依存です。macOSでは、新しいSceneが作成されてExternal Eventのために使うことになるでしょう。iOSでは、システムは既存のSceneを使うことを選ぶでしょう。

On platforms that only allow a single Window/Scene, this method is ignored, and incoming External Events are always routed to the existing single Scene. 単一のWindow/Sceneを許可するだけであるプラットホームでは、このメソッドは無視されます、そしてやってくるExternal Eventそれらは常に既存の単一のSceneに向かわされます。