Posts

Post not yet marked as solved
1 Replies
There is an example of this for UIKit here: https://github.com/steventroughtonsmith/VisionExpandingSidebar/tree/main Looks like it uses a new UIScene preferences type for VisionOS. https://developer.apple.com/documentation/uikit/uiwindowscene/geometrypreferences/reality However, I'm unable to find a declarative analog to this with SwiftUI. You can set the max and min sizes, but it's unclear how to request preferred size for the window, as you can with the size property.
Post marked as solved
2 Replies
Xcode 14 RC is a production release build. As such, it only includes non-beta SDKs. Since the macOS 13 SDK is still in beta, Xcode 14 RC does not contain the macOS 13 SDK. Rather, it contains the current production macOS SDK, which is macOS 12.x. You cannot ship apps for macOS 13 until the 13 SDK is out of beta. This will occur later this year. A future version of Xcode 14 will contain both the new release iOS 16 SDK and new release macOS 13 SDK when it is out of beta. Until that time, for the continued development of macOS 13, use the latest Xcode 14 beta.
Post marked as solved
13 Replies
To remove this padding globally for all plain table views...  if #available(iOS 15.0, *) { UITableView.appearance().sectionHeaderTopPadding = CGFloat(0) } Note: this does not appear to effect the padding for grouped table views. (Thankfully!)
Post not yet marked as solved
6 Replies
Post not yet marked as solved
1 Replies
If SceneKit seralizes your scene to disk using NSCoder, then you should be able to implement NSCoder coding and decoding methods to retain your custom subclasses and their data. That would include implemnenting a way to encode and decode your custom subclass properties.
Post not yet marked as solved
16 Replies
SceneKit is referenced in a number of AR and 3D related technologies and USD is deeply integrated into SceneKit. Scenes can be exported to USDZ. USD PBR material options, such as "clear coat", have been added, etc. While this isn't a major new rendering or animation feature, like motion blur or vertex skinning, it makes SceneKit a first class way to render USD content. Core data hasn't seen many updates lately, but that doesn't mean it's "dead."
Post not yet marked as solved
24 Replies
The most likely recommended strategy is to create a view model for each item you want to pass to your SwiftUI view, along with a datasource class with properites for a PassthroughDataSource, NSFetchedResultsController and an array of view models.Set your datasource as the results controller delegate and configure your results contrller fetch predicate. Your view model should have an initalizer that takes an NSManagedObject and sets the properties you want to display in your UI. When the delegte method is called, enumerate over the results, create view models initalized with the resulting core data objects, append them to the array, then call send(.self) on your PassThroughSubject.I usually add a createSampleData() method that populates the same array with hard coded view models initalized with test data for use with the preview provided. class MyManagedObject: NSManagedObject { @NSManaged var name: String? @NSManaged var age: NSNumber? } struct MyViewModel { var name: String var age: String init(managedObject: MyManagedObject) { self.name = managedObject.name ?? "" self.age = "\(managedObject.age)" ?? "" } } final class QueryListStore: NSObject, BindableObject, NSFetchedResultsControllerDelegate { var didChange = PassthroughSubject<queryliststore, never="">() var results = [MyViewModel]() var controller = NSFetchedResultsController() override init() { super.init() /* Create and configure fetched results controller */ controller.delegate = self do { try controller.performFetch() } catch { fatalError("Failed to fetch entities: \(error)") } } func controllerDidChangeContent(_ controller: NSFetchedResultsController) { var viewModels = [MyViewModel]() /* Iterate over results, initalizing view models from your managed objects and adding them to the array let viewModel = MyViewModel(managedObject: managedObject) viewModels.append(viewModel) */ self.results = viewModels didChange.send(self) } }