Skip to content

Commit cc9a608

Browse files
committed
updated
1 parent 5c90aa3 commit cc9a608

File tree

7 files changed

+23
-21
lines changed

7 files changed

+23
-21
lines changed

Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"location" : "https://github.com/flocked/FZSwiftUtils.git",
1717
"state" : {
1818
"branch" : "main",
19-
"revision" : "3d3c17661294c6259f357fbb15a46e8ac994bb54"
19+
"revision" : "53d5e5eddef6ad50801f6fa8ec7ba0f7cdb0b8f7"
2020
}
2121
},
2222
{
@@ -25,7 +25,7 @@
2525
"location" : "https://github.com/flocked/FZUIKit.git",
2626
"state" : {
2727
"branch" : "main",
28-
"revision" : "91b1950ebb5ea6edb739bc6194032234b5d4dc2a"
28+
"revision" : "dce510c9a79b160102efef0c08aefb83a4ee90b8"
2929
}
3030
}
3131
],

Example/Example/Base.lproj/Main.storyboard

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,7 @@ Quicklook collection items via spacebar and favorite them by right-clicking them
837837
<splitViewItems>
838838
<splitViewItem canCollapse="YES" holdingPriority="260" behavior="sidebar" id="bFe-Mf-mBl"/>
839839
<splitViewItem id="7hD-QQ-ruv"/>
840+
<splitViewItem collapsed="YES" id="CKi-lU-ho8"/>
840841
</splitViewItems>
841842
<splitView key="splitView" dividerStyle="thin" vertical="YES" id="Wb5-Zx-fWz">
842843
<rect key="frame" x="0.0" y="0.0" width="700" height="500"/>
@@ -845,6 +846,7 @@ Quicklook collection items via spacebar and favorite them by right-clicking them
845846
<connections>
846847
<segue destination="IgV-tW-gYz" kind="relationship" relationship="splitItems" id="NB4-kc-ruk"/>
847848
<segue destination="f1U-rY-vlz" kind="relationship" relationship="splitItems" id="wfQ-Cb-UbV"/>
849+
<segue destination="pHe-8d-Ckn" kind="relationship" relationship="splitItems" id="2qV-WD-Wbi"/>
848850
</connections>
849851
</splitViewController>
850852
<customObject id="yJe-I5-mQc" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>

Example/Example/SplitViewController.swift

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,10 @@ import Cocoa
99
import FZUIKit
1010

1111
class SplitViewController: NSSplitViewController {
12-
13-
let outlineSidebarItem = NSSplitViewItem(sidebarWithViewController: OutlineSidebarViewController.loadFromStoryboard()!)
14-
var tableSidebarItem: NSSplitViewItem!
15-
16-
override func viewDidLoad() {
17-
super.viewDidLoad()
18-
19-
outlineSidebarItem.isCollapsed = true
20-
splitViewItems.insert(outlineSidebarItem, at: 1)
21-
}
2212

2313
func swapSidebar() {
2414
splitViewItems[0].isCollapsed = true
25-
splitViewItems.swapAt(0, 1)
15+
splitViewItems.swapAt(0, 2)
2616
splitViewItems[0].isCollapsed = false
2717
}
2818

Example/Example/TableSidebarViewController.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,13 @@ class TableSidebarViewController: NSViewController {
8787
segmentedControl.selectedSegment = 0
8888
}
8989
}
90+
91+
struct Handlers {
92+
var options: ((_ draggingInfo: any NSDraggingInfo)->(NSSpringLoadingOptions))?
93+
}
94+
95+
protocol AAAAa {
96+
97+
func options(_ draggingInfo: any NSDraggingInfo) -> NSSpringLoadingOptions
98+
99+
}

Sources/AdvancedCollectionTableView/DiffableDataSource/NSCollectionView/CollectionViewDiffableDataSource+Delegate.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,14 @@ extension CollectionViewDiffableDataSource {
164164

165165
func validateDropInto(_ draggingInfo: NSDraggingInfo, _ proposedIndexPath: IndexPath) -> NSDragOperation {
166166
guard dataSource.droppingHandlers.isDroppableInto, let handler = dataSource.droppingHandlers.canDropInto, let element = dataSource.element(for: proposedIndexPath) else { return [] }
167-
let content = draggingInfo.draggingPasteboard.content()
167+
let content = draggingInfo.draggingPasteboard.content
168168
dropIntoElement = !content.isEmpty && handler(content, element) ? element : nil
169169
return dropIntoElement != nil ? .copy : []
170170
}
171171

172172
func validateDrop(_ draggingInfo: NSDraggingInfo) -> NSDragOperation {
173173
guard let canDrop = dataSource.droppingHandlers.canDrop, let elementsHandler = dataSource.droppingHandlers.elements else { return [] }
174-
let content = draggingInfo.draggingPasteboard.content()
174+
let content = draggingInfo.draggingPasteboard.content
175175
if !content.isEmpty && canDrop(content) {
176176
droppingElements = elementsHandler(content)
177177
}
@@ -251,11 +251,11 @@ extension CollectionViewDiffableDataSource {
251251
return false
252252
}
253253
} else if dropOperation == .on, let element = dropIntoElement {
254-
let content = draggingInfo.draggingPasteboard.content()
254+
let content = draggingInfo.draggingPasteboard.content
255255
dataSource.droppingHandlers.didDropInto?(content, element)
256256
return true
257257
} else if dropOperation == .before, !droppingElements.isEmpty {
258-
let content = draggingInfo.draggingPasteboard.content()
258+
let content = draggingInfo.draggingPasteboard.content
259259
let transaction: DiffableDataSourceTransaction<Section, Element> = dataSource.dropTransaction(droppingElements, indexPath: indexPath)
260260
dataSource.droppingHandlers.willDrop?(content, droppingElements, transaction)
261261
dataSource.apply(transaction.finalSnapshot, dataSource.droppingHandlers.animates ? .animated : .withoutAnimation)

Sources/AdvancedCollectionTableView/DiffableDataSource/NSOutlineView/OutlineViewDiffableDataSource.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ public class OutlineViewDiffableDataSource<ItemIdentifierType: Hashable>: NSObje
763763
return reorderingHandlers.canReorder?(draggedItems, item as? ItemIdentifierType) ?? true == true ? .move : []
764764
} else if let canDrop = droppingHandlers.canDrop {
765765
dropItems = []
766-
dropContent = info.draggingPasteboard.content()
766+
dropContent = info.draggingPasteboard.content
767767
if canDrop(dropContent, item as? ItemIdentifierType), let items = droppingHandlers.items?(dropContent, item as? ItemIdentifierType), !items.isEmpty {
768768
dropItems = items
769769
return .move

Sources/AdvancedCollectionTableView/DiffableDataSource/NSTableView/TableViewDiffableDataSource.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ open class TableViewDiffableDataSource<Section, Item>: NSObject, NSTableViewData
527527
}
528528

529529
if draggingInfo.draggingSource as? NSTableView !== tableView, let canDrop = droppingHandlers.canDrop, !(row == 0 && sectionRowIndexes.contains(row) && dropOperation == .above), (!sectionRowIndexes.contains(row) || (!sectionRowIndexes.contains(row+1) && dropOperation == .above) ) {
530-
let content = draggingInfo.draggingPasteboard.content()
530+
let content = draggingInfo.draggingPasteboard.content
531531
dropTargetRow = dropOperation == .on ? row : nil
532532
let target = dropOperation == .on ? item(forRow: row) : nil
533533
if !content.isEmpty, canDrop(content, target) {
@@ -556,7 +556,7 @@ open class TableViewDiffableDataSource<Section, Item>: NSObject, NSTableViewData
556556
return true
557557
}
558558
if draggingInfo.draggingSource as? NSTableView !== tableView, canDrop {
559-
let content = draggingInfo.draggingPasteboard.content()
559+
let content = draggingInfo.draggingPasteboard.content
560560
var items: [Item] = []
561561
var target: Item?
562562
var transaction: DiffableDataSourceTransaction<Section, Item>? = nil
@@ -657,7 +657,7 @@ open class TableViewDiffableDataSource<Section, Item>: NSObject, NSTableViewData
657657

658658
public func tableView(_ tableView: NSTableView, updateDraggingItemsForDrag draggingInfo: NSDraggingInfo) {
659659
if canDrop {
660-
let items = droppingHandlers.items?(draggingInfo.draggingPasteboard.content()) ?? []
660+
let items = droppingHandlers.items?(draggingInfo.draggingPasteboard.content) ?? []
661661
} else if canDragItems, let draggingImage = draggingHandlers.draggingImage {
662662
draggingInfo.enumerateDraggingItems(for: tableView, classes: [IdentifiablePasteboardItem.self], using: { draggingItem,_,_ in
663663
if let row = (draggingItem.item as? IdentifiablePasteboardItem)?.row, let item = self.item(forRow: row) {

0 commit comments

Comments
 (0)