Drag and drop with custom type identifier doesn't work

后端 未结 1 1299
礼貌的吻别
礼貌的吻别 2020-12-21 01:55

I\'m trying to achieve drag and drop on macOS with a custom type identifier to avoid collisions but it doesn\'t seem to work. First, here\'s a working example with a pub

相关标签:
1条回答
  • 2020-12-21 02:24

    The typeIdentifier in above is not just a unique string, it must be UTI.

    If you want to use some custom-application-specifc UTI (think twice if you really need it), then you have to register one according to Apple rules, starting from

    <key>UTExportedTypeDeclarations</key>
            <array>
                <dict>
                    <key>UTTypeIdentifier</key>
                    <string>com.procrastin8.plzwork</string>
                    ...
    

    in app Info.plist

    See details specifically in Declaring New Uniform Type Identifiers

    And wide collection in Technical Q&A QA1796

    0 讨论(0)
提交回复
热议问题