我已经设置了我的macOS应用程序,以便能够处理以xcasset扩展名结尾的文件夹。这并不适合所有用户,因此我想将其作为可选的首选项。有没有办法在应用程序内以编程方式打开和关闭它,还是有另一种方法来实现这种行为?
这是我目前设置的plist数据。
<dict>
<key>CFBundleTypeName</key>
<string>Asset</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>LSTypeIsPackage</key>
<true/>
<key>CFBundleTypeExtensions</key>
<array>
<string>xcassets</string>
<string>xcstickers</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>