Created
March 6, 2020 01:33
-
-
Save johnsusek/fab21d4629d1e2236c8927e507c53502 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func outlineViewItemWillExpand(_ notification: Notification) { | |
if let entity = notification.userInfo?["NSObject"] as? DesktopFolderEntity { | |
guard let sortDescriptor = self.outlineView.sortDescriptors.first else { return } | |
entity.isExpanding = true | |
let childrenFetch = BlockOperation { | |
entity.buildChildren() | |
entity.sortChildren(sortDescriptor: sortDescriptor) | |
OperationQueue.main.addOperation { | |
entity.isExpanding = false | |
self.outlineView.reloadData() | |
} | |
} | |
self.childrenFetchQueue.addOperation(childrenFetch) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment