In iOS 18.4.1, DocumentGroup contains the DocumentView twice. (this may cause issues with alerts)
To reproduce (iOS 18.4):
In XCode Version 16.3 (16E140), create new project. Choose iOS, "Document App". No need to make code changes.
Compile and run app on iOS 18.4 (simulator or device).
in iOS (sim or device): Tap create document (once the app launched).
in XCode: click "Debug View Hierarchy"
in XCode: rotate the view Hierarch to reveal duplicated Document View hierarchies (2 Document Hosting Controllers), see screenshot.
This probably affects alert view... I get warnings and it does not work properly (used to work ok on previous versions).
Previous versions
To compare with previous versions of iOS, run the same code and procedure on iOS 18.3 for example (see screenshot).
Will report on Feedback assistant as well...
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi,
I am using HealthKit for the first time.
I am using HKStatisticsCollectionQuery.
I am running my code iOS 17 on a physical iPhone.
It takes several seconds to query data, for example 1 day worth of heart rate at 1 minute resolution. I changed the resolution to 1 hour, expecting it to be faster, but it's pretty much the same…
I have been following the official documentation and sample code.
I also compiled in Release, but that didn't really help for HKStatisticsCollectionQuery.
I quickly looked with Instruments, the app is spending a lot of time in decoding data with NSXPCDecoder.
Is there a way to speed data retrieval? Or this is "expected" latency?
In a Document-based app, in SwiftUI (iOS 17), how to bring to front the window that shows an already open document, when trying to open the same document from the file browser, instead of opening a new window?
This is to prevent opening the document twice and being able to edit it in 2 different editors.
The official demo [1] does not handle this case.
[1] https://developer.apple.com/documentation/swiftui/building_a_document-based_app_with_swiftui
I am trying to update XCode to 13.2 on Monterey.
It's stuck at "Installing 7.49GB of 7.49GB" (been for a while...).
I tried rebooting the mac and and the install is still stuck.
Reported issue on Feedback assistant (number FB9808696).
What can I do?
Previous version of XCode still runs ok.
How can one set MKMapView scale unit to use the metric system (meter, kilometer) or the imperial system (foot, mile) in an app, in code?
I looked in the SwiftUI documentation, I could not find any mention of this in the MKMapView doc.
My phone is set to use metric system (metres) and Apple Maps does show the scale meters; but not my app.
Thanks
Context
While extending the Array type to conform to VectorArithmetic (for core animation experiment):
extension Array: VectorArithmetic where Element: VectorArithmetic & AdditiveArithmetic { ... }
I get the following error:
Referencing operator function '*' on '_VectorMath' requires that 'Element' conform to '_VectorMath'
and when calling the scale(by:) method:
Referencing instance method 'scale(by:)' on 'Array' requires that 'Double' conform to '_VectorMath'
Workaround
Making type Element and Double conform to _VectorMath fixed the issue:
extension Array: VectorArithmetic where Element: _VectorMath & VectorArithmetic & AdditiveArithmetic { ... }
extension Double: _VectorMath { }
Questions
I tried looking for information on _VectorMath (note the underscore prefix) but I could not find anything in the official docs and not much on the internet.
What is _VectorMath protocol?
Where is it defined?
Is it ok to use it like this?
Or should I use a different approach?