Post

Replies

Boosts

Views

Activity

Reply to Parsing Dates Without Times
I found this explanation very useful in the context of debugging an off-by-one-day bug in my crossword app. It's a classic scenario where crosswords are referenced by date but without a specific time, except that the date is usually reckoned by the time zone of the host publication. I thought I would share an example of how I'm addressing the issue using the defaultDate technique, but generalizing it to choose a "middle of the day" time that should work with whatever time zone (Quinn's example uses a fixed relative time interval that is specific to Sao Paolo). Given a date formatter that already has the desired time zone set on it: var midDayComponents = DateComponents(hour: 12) midDayComponents.calendar = Calendar(identifier: .gregorian) midDayComponents.timeZone = dateFormatter.timeZone dateFormatter.defaultDate = midDayComponents.date It seems that all you need is an hour, a calendar, and a time zone to come up with a suitably mid-day date. I hope this helps somebody!
Topic: App & System Services SubTopic: General Tags:
Jun ’23
Reply to Frameworks Info.plist is missing plist key after archive
From the Xcode 15 Release Notes: Fixed: Resolved an issue where the “Manage version and build number” distribution option in Xcode and Xcode Cloud overwrote the version and build number of framework dependencies in apps. When distributing an app, framework dependencies retain their original version and build numbers. (106869375) So it seems the change was intentional, presumably because other people found it problematic that Xcode was overwriting their framework's Info.plist values. If you have a framework dependency that doesn't include version information it's probably a good idea to file a bug with them to ask them to add the pertinent values.
Dec ’23
Reply to How to make HoverEffectComponent of an Entity in a RealityView visible in visionOS 1.0 Simulator?
I was able to get this working just now with a simple programmatic demo: struct ContentView: View { var body: some View { VStack { RealityView { content in let sphereResource = MeshResource.generateSphere(radius: 0.05) let myMaterial = SimpleMaterial(color: .blue, roughness: 0, isMetallic: true) let myEntity = ModelEntity(mesh: sphereResource, materials: [myMaterial]) var collision = CollisionComponent(shapes: [.generateSphere(radius: 0.05)]) collision.filter = CollisionFilter(group: [], mask: []) myEntity.components.set(collision) let input = InputTargetComponent(allowedInputTypes: .all) myEntity.components.set(input) let hoverComponent = HoverEffectComponent() myEntity.components.set(hoverComponent) content.add(myEntity) } } .frame(width: 800, height: 800) .padding(30) .background(.black) } } Maybe if you can get this simple example working it will help you see how yours differs. Daniel
Topic: App & System Services SubTopic: Core OS Tags:
Feb ’24