Post

Replies

Boosts

Views

Activity

Reply to CloudKit + Core Data General Questions (HIG)?
Oh cool, I guess cmd+s is "post"....2) I'm curious if there's a means to allow the user to choose the version of the data in CloudKit or the version of the data on Device. My data sort of adds up to an expected whole. If one record is added or deleted, then the sum of the records will be incorrect. To give the user a good experience, I'd like to give them the ability to pick a snapshot of two different versions of their entire data set.Can `NSPersistentCloudKitContainer` facilitate this in anyway?3) Is there a best practices guide or design pattern recommendations with recards to UX anywhere?
Feb ’20
Reply to UITableView Drag and Drop to Move Row Does Not Work
Link to sample project uploaded to Github: https://github.com/johnpdavis/catalyst_reorder_example https://github.com/johnpdavis/catalyst_reorder_example/blob/master/catalyst_reorder_example/ViewController.swift Contains the configuration of the UITableView. Running this on iOS you will observe the rows can be grabbed and drop to rearrange them. Running this on macCatalyst you will observe the rows can be grabbed, but not dropped.
Jun ’20
Reply to Open folder in UIKit for Mac
Mac Users are used to Drag and Drop as a primary means of interaction, and as you've discovered the act of dropping the folder onto your app will give you app sandbox permission to read the folder and its contents. If you want to provide an open dialog use UIDocumentPickerViewController. This picker will display like NSOpenPanel from AppKit, but is compatible with iPad and iPhone builds of your app too.
Jun ’20
Reply to How to debug Auto Layout in UIKit?
If you get a constraints error at runtime you can try pasteing it into a site like wtfautolayout.com . It can provide a useful visualization of the constraints. I believe if you name your view elements in the xib/storyboard editor’s sidebar those names will show up in the constraints, but I’m less certain about it without loading a project. It’s a good practice nonetheless!
Jun ’20
Reply to Why does my text label relative vertical position move when user transitions from landscape to portrait orientation?
Hmm, could it be the content-hugging priority on the second-to-last label? Maybe it’s low and that label is vertically stretching? Either way, this is a great use case for the view hierarchy debugger: https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/debugging_with_xcode/chapters/special_debugging_workflows.html The view hierarchy debugger can help you visualize what’s going on with the view layouts, and hopefully illuminate where the problem may be.
Jun ’20
Reply to Why is .stateRestorationActivity always nil in willConnectTo: ?
I'm observing the same behavior in my App. I return non-nil restoration activities for three windows. When reopening the app it reopens three windows, but they all end up defaulted because there's no restoration activity when reconnecting the scenes. (Catalyst only of course. This works on iPadOS and iOS) Kind of a bummer, and leads to some confusing re-open activity when the app relaunches.
Jun ’20
Reply to State Restoration via SceneDelegate not working
Spoke with an engineer during a WWDC2020 Lab about this. My issue, as odd as it seems, was restarting the application too soon after quitting it. iOS applications running on Catalyst will linger after being quit. This behavior can be observed in Activity Monitor after performing right-click-> quit on the App's icon. It was explained that this is the period where the app can finish any registered background tasks. After waiting for my application to disappear from ActivityMonitor and then relaunching, it restored the activity provided in stateRestorationActivity(for scene: UIScene).
Jun ’20
Reply to Why is .stateRestorationActivity always nil in willConnectTo: ?
Spoke with an engineer during a WWDC2020 Lab about this. My issue, as odd as it seems, was restarting the application too soon after quitting it. iOS applications running on Catalyst will linger after being quit. This behavior can be observed in Activity Monitor after performing right-click-> quit on the App's icon. It was explained that this is the period where the app can finish any registered background tasks. After waiting for my application to disappear from ActivityMonitor and then relaunching, it restored the activity provided in stateRestorationActivity(for scene: UIScene).
Jun ’20
Reply to Catalyst or SwiftUI Multiplatform?
There are changes to Catalyst where iOS elements can take on macOS like appearances in BigSur as long as you flip the toggle that makes the Mac app macOS 11 only. For this reason, I will exclusively be using SwiftUI + UIKit + Catalyst for making my iPad/iPhone/Mac apps. Though SwiftUI-only is tempting for apps with simple view structures, I’ll probably wait for SwiftUI 3 or 4 before really diving into it. For simple views that would require a lot of UIKit Boilerplate, swiftUI is great and easy to display in UIKit-land via UIHostingController. For highly animated interactionS I’ve started to drift to SwiftUI as well, as you can accomplish more animation magic with less code. Maybe even avoiding all that UIPresentationController logic all together. Like a user said above, swiftUI easily solve problems that are difficult in UIKit, and UIKit can provide control and power that SwiftUI abstracts from you. My goal at the end of the day is to write less code. Less code is easier to maintain!
Jun ’20