Post

Replies

Boosts

Views

Activity

Criteria for snapshotForExpandingParent being invoked?
I've got a collectionList section that has some items that can be expanded, but they need to be done so lazily when the user taps them. (The children of these objects can only be retrieved asynchronously.) I've given these expandable rows an "outline" disclosure indicator but when the row is tapped neither shouldExpandItem nor snapshotForExpandingParent is being invoked on the sectionSnapshotHandlers of the DataSource. I notice there's no sample code for this and I'm curious if there's a particular way I need to configure the items in the original section snapshot to enable their expansion.
2
0
494
Jul ’20
Updating Cell Accessories after Configure?
I've got an asynchronous validation method that validates the underlying model of a cell when the cell is displayed on screen. When the validation completes, I modify the cell accessories to include an additional button that can be tapped for error details. This validation is invoked within a  UICollectionView.CellRegistration. It seems that modifying the cell-accessories after the cell has returned (via the async completion handler) does not trigger a view update of said cell. Should it? Or is it better for me to persist this information in the model object and trigger a the snapshot update?
3
0
1.2k
Jul ’20
UICollectionView Lists and targetIndexPathForMoveFromItemAt
I'm trying to implement row reordering with the new reorderingHandlers. Some of the items in my CollectionView-OutlineView can only be dropped to certain destinations. I'm attempting to implement targetIndexPathForMoveFromItemAt to provide correct destination IndexPaths. I'm observing that the originalIndexPath for an item that's being reordered appears to change during the life of the drag in an outline view. It almost seems that originalIndexPath follows the value of the proposedIndexPath during the life of the drag. This makes it difficult to determine valid drop locations for different types of items in the outline view. Example output of originalIndexPath and proposedIndexPath (without letting go and letting the move proceed) PROPOSE MOVING SOURCE AT: [3, 1] TO [[3, 1]] PROPOSE MOVING SOURCE AT: [3, 1] TO [[3, 0]] PROPOSE MOVING SOURCE AT: [3, 0] TO [[3, 1]] PROPOSE MOVING SOURCE AT: [3, 1] TO [[3, 0]] PROPOSE MOVING SOURCE AT: [3, 0] TO [[3, 0]] I expect the proposedIndexPath to change as I move through the list, but the originalIndexpath changing surprised me.
0
0
374
Jun ’20
State Restoration via SceneDelegate not working
When quitting my catalyst application via the dock icon (right click -> quit) my SceneDelegate's stateRestorationActivity(for scene: UIScene) method is called and I return a non-nil NSUserActivity. However, when restarting my application there is no user activity in the connectionOptions of scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) Does this function correctly for anyone else? Do I need to build my UserActivity in a specific way for this to work in Catalyst? It functions correctly when running on iOS.
1
0
712
Jun ’20
UITableView Drag and Drop to Move Row Does Not Work
I am trying to use a drag delegate and drop delegate to rearrange rows in a UITableView. This is instead of using the edit-mode and move-handles that invoke the the moveRowAt of UITableViewDataSource. The use of the drag delegate and drop delegate to accomplish this works great when running on iOS, but not on mac running via Catalyst. What I see: tableView(_ tableView: UITableView, itemsForBeginning session: UIDragSession, at indexPath: IndexPath) is called. tableView(_ tableView: UITableView, canHandle session: UIDropSession) -> Bool is not called. I'm not sure what else I can do to make the UITableView happy if this functionality already works on iOS. The tableview is configured like:             tableView.dragDelegate = self             tableView.dropDelegate = self             tableView.dragInteractionEnabled = true This is my final blocker before releasing a catalyst app for 10.15, and I would like to get it resolved before 10.16. FB7737498 is filed to capture this behavior and has a sample project attached. If there is an acceptable project host for the new forum, I can attach it here as well.
3
0
2.9k
Jun ’20
Transition Animations of GrandChild Views?
I have a parent view that conditionally contains a subview that contains a grid of buttons. I'd like the buttons to each transition in a unique way when the grid appears. I'm able to get the grid container to transition in from the side, but any transition I use on the grand-child buttons is not respected.
0
0
288
Feb ’20
CloudKit + Core Data General Questions (HIG)?
I've got a few quetsions about designing an acceptable user experience involving migrating from legacy Core Data store to a CloudKit+CoreData store.Given the user can have a legacy data store on all of their devices and only one of those sets of data will be considered supreme, I need a means to effectively merge all this data in a non-destructive way.1) Does NSPersistentCloudKitContainer provide a means of opting into or out of CLoudKit storage for the user? Is it fully reliant on the user going into settings and flipping the iCloud-Data switch? Or can I maintain a local app settings flag? Can I tell a NSPersistentCloudKitContainer to no longer sync during it's lifecycle? 2)
1
0
586
Feb ’20
Catalyst NSSharingServicePickerToolbarItem - unrecognized selector
Trying to add an `NSSharingServicePickerToolbarItem` to the NStoolbar of my scene's window, but when I set the `NSSharingServicePickerToolbarItem`'s activityItemsConfiguration to a class that implements `UIActivityItemsConfigurationReading` I get -[MYAPP.MYCLASS _uinsApplicationActivityProxies]: unrecognized selector sent to instance 0x6000026331e0I'm not exactly sure how I can satisfy this unrecognized selector given it appears to be for a private method. Thoughts?
2
0
785
Nov ’19
Black Screen After Dismissing Modal Controller
Hey All,Been digging around the internet looking for this one, and while stackoverflow has some relevant solutions, none are working for me.My View Hierarchy is the followingView--->UISplitViewController.view ( set as a child viewController )--------> rootViewController.view (set as the mainViewController of the splitView)--------> detailViewController.view (set as the detailViewController of the splitview)Via the iPhone 6 simulator(split view is always collapsed) I present a modal viewcontroller with the following code: UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController]; [navigationController.navigationBar setBarStyle:UIBarStyleBlack]; [navigationController setModalPresentationStyle:UIModalPresentationPopover]; navigationController.popoverPresentationController.sourceView = view; navigationController.popoverPresentationController.barButtonItem = barButtonItem; navigationController.popoverPresentationController.delegate = self; [self presentViewController:nav animated:YES completion:nil];I dissmiss the presented controller from that viewController by calling:[self dismissViewControllerAnimated:true completion:nil];If I set animated to "false" I dont have any problems, but it looks bad and doesnt make sense.I see some posts regarding this and custom presenatation methods, but Im not using anything custom here.Any Help is appreciated!EDIT:On iPhone the ModalPresentationStyle should default to UIModalPresentationOverFullScreen, so I tried setting the presentationStyle directly to that, and it worked!If I set the presentationStyle to "FullScreen" I get the same behavior, a black screen after dismissing.
2
0
3.6k
Dec ’15