Posts

Post not yet marked as solved
0 Replies
192 Views
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
Posted
by randomdev.
Last updated
.
Post not yet marked as solved
50 Replies
94k Views
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.
Posted
by randomdev.
Last updated
.
Post not yet marked as solved
0 Replies
652 Views
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
Posted
by randomdev.
Last updated
.
Post not yet marked as solved
4 Replies
1.2k Views
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?
Posted
by randomdev.
Last updated
.