Swift 4: NSFilenamesPboardType not available. What to use instead for registerForDraggedTypes?

后端 未结 7 721
一向
一向 2020-12-28 08:11

After migrating to Swift4 the following code raise compile error:

public final class MediaItemView: NSView {

   public override init(frame frameRect: NSRect         


        
7条回答
  •  再見小時候
    2020-12-28 08:34

    i use this as the solution

        //Temp solution for this
        let NSFilenamesPboardTypeTemp = NSPasteboard.PasteboardType("NSFilenamesPboardType")
    
        self.zipView.registerForDraggedTypes([NSFilenamesPboardTypeTemp])
    

    it's seem a bug from apple,them marked the api as work in 10.13 only.

提交回复
热议问题