Post

Replies

Boosts

Views

Activity

What is the state diagram associated with Network's NWConnection?
What are the possible transitions within NWConnection.State? Are cancelled and failed both terminal states? (Implying that I should drop the connection and attempt to set up a new one if I want to reconnect?) The common flow of setup -> preparing -> ready I've observed, but I wasn't sure how waiting fit in. What transitions are legal (and managed) by NWConnection? (mermaid couldn't handle this diagram - but I wrote it out anyway) Are these transitions all valid? [*] --> setup cancelled --> [*] failed --> [*] setup --> preparing preparing -> ready preparing -> cancelled preparing -> failed ready -> waiting ready -> failed ready -> cancelled waiting -> cancelled waiting -> preparing waiting -> failed
0
0
728
Jul ’23
Are the new Semantic Embeddings in CoreSpotlight multi-lingual?
After watching https://developer.apple.com/wwdc24/10131, I'm curious if the semantic embeddings used to provide the "search of meaning" with this new capability are encoded with multi-lingual embeddings? In particular, if I have content that is mixed in Korean and English, can those be seamlessly indexed together and queries in one language (english) find relevant content that was offered to be indexed as Korean?
0
1
715
Jun ’24
Can I generate a docc archive directly from Package.swift?
If the library I want to document is primarily tracked with a Package.swift cross-platform definition, what's the optimal way to build and render documentation? Can I still use xcodebuild docbuild with the Package.swift format for the project, or does the documentation system require a fully-defined Xcode project wrapped around it? Or do I need to open the Package.swift file in Xcode and then generate the docc archive from Xcode's Product menu?
1
0
2.1k
Jun ’21
What's the pattern to provide organization around properties and methods within a struct or class?
I'm using DocC to add documentation to an existing swift package, and the basics are working great - properties and methods showing up, linked pages, all the stuff you'd hope for. I'd like to update the structure within the struct (or class) to organize the methods and properties a bit more akin to how Apple does it in their documentation - not just the default headers, but organized by why you'd use them. Can this be done in DocC using headings within the doc comments in the source file directly, or do we need to add an Extension file with the same symbol name at the top to override and provide that additional structure? The extension template looks like it might be redundant with the summary and overview sections, since that same area is (I think) what comes from the doc comments in the source headers. # ``Symbol`` Summary ## Overview Text ## Topics ### Group - ``Symbol``
1
0
1.3k
Nov ’21
Has anyone had luck getting USD to compile AND work with M1/arm64 native python?
I've been trying to build and use the USD command line toolchain pieces from source on an M1/arm64 Mac - and while I've gotten it to compile, I get a crash as python attempts to load up the USD internals: ------------------------------ python terminated ------------------------------- python crashed. FATAL ERROR: Failed axiom: ' Py_IsInitialized() ' in operator() at line 148 of /Users/heckj/src/USD/pxr/base/tf/pyTracing.cpp writing crash report to [ Sparrow.local:/var/folders/8t/k6nw7pyx2qq77g8qq_g429080000gn/T//st_python.79467 ] ... done. -------------------------------------------------------------------------------- I found a number of issues at Github, which hints that this is a potentially known and ongoing problem: https://github.com/PixarAnimationStudios/USD/issues/1620 referenced issue: https://github.com/PixarAnimationStudios/USD/issues/1466 referenced issue: https://github.com/PixarAnimationStudios/USD/issues/1736 With some suggestions, but no clear resolutions. I tried the build commands that are referenced in the release details for USDPython as available on developer downloads, and fiddling it a bit got it to compile: python build_scripts/build_usd.py \ --build-args TBB,arch=arm64 \ --python --no-imaging --no-usdview \ --prefer-safety-over-speed \ --build-monolithic /opt/local/USD But I'm repeatedly hitting the crash where python isn't initializing. I've tried Python 3 from home-brew, an Anaconda version of python (intel through Rosetta), the basing it on the python included with Xcode (universal binary), and the most recent trial was with miniforge3 arm-native python that's recommended from the Metal for Tensorflow marketing page. WIth the warnings about Python disappearing from the default install, I'd like to get a mechanism in place that I'm comfortable with to get an install of USDtools, and ideally that are native to the M1 processor.
1
0
3.3k
Aug ’22
Chart: How to achieve a specific X-axis (an awkward log scale)
I'm trying to determine how best to achieve a desired result within Swift Charts. I'm trying to make a sort-of "reversed" log chart. The use case here is for driving into the details of the percentiles from a series latency values stored within a histogram. The X axis percentile values I was hoping to achieve was something along the lines of: 10, 50, 90, 99, 99,9, 99.99, 99.999 With those values being fairly evenly distributed across the chart. If I look at this from an inverted sequence of: ( 1 - (some value) ).reversed() where the values are: 0.00001, 0.0001, 0.0001, 0.001, 0.01, 0.5, 0.1 But I've been struggling with how to start with those values, scale the X axis using a 1-value kind of setup, and then overlaying the values that are more human readable to achieve the end result. Any suggestions on how to tackle this scenario with customizing a chart axis?
1
0
1.9k
Mar ’23
Is there a way to apply for formatting option to a Dataframe column outside of the explicit description(options:) method?
I'm building up a data frame for the sole purpose of using that lovely textual grid output. I'm getting output without any issue, but I'm trying to sort out how I might apply a formatter to a specific column so that print(dataframeInstance) "just works" nicely. In my use case, I'm running a function, collecting its output - appending that into a frame, and then using TabularData to get a nice output in a unit test, so I can see the patterns within the output. I found https://developer.apple.com/documentation/tabulardata/column/description(options:), but wasn't able to find any way to "pre-bind" that to a dataframe Column when I was creating it. (I have some double values that get a bit "excessive" in length due to the joys of floating point rounding) Is there a way of setting a formatter on a column at creation time, or after (using a property) that could basically use the same pattern as that description method above?
1
0
1k
Nov ’23
What version of KTX is supported by CubeMap in Reality Composer Pro?
I was reading through cube-image node docs and it talked about loading data from a cubemap file in ktx format. It wasn’t clear if that was only for the original KTX format, and if that node was also able to take advantage of the KTX2 format? Is this shader node only relevant for files in the original (v1) KTX format?
1
0
1.2k
Jun ’24
How to wrangle Sendable ReferenceFileDocument and SwiftUI
I recently circled back to a SwiftUI Document-based app to check on warnings, etc. with Xcode 16 and Swift 6 now released. I just found a suite a new errors that indicate that ReferenceFileDocument is now expected to be Sendable, which seems very off for it fundamentally being a reference type. I followed the general pattern from earlier sample code: Building Great Apps with SwiftUI, which goes from an Observable object to adding conformance to ReferenceFileDocument in an extension. But then the various stored properties on the class cause all manner of complaint - given that they're not, in fact, sendable. What is an expected pattern that leverages a final class for the ReferenceDocument, but maintains that Sendability? Or is there a way to "opt out" of Sendability for this protocol? I'm at a bit of a loss on the expectation that ReferenceFileDocument is sendable at all, but since it's marked as such, I'm guessing there's some path - I'm just not (yet) clear on how to accomodate that.
1
0
657
Oct ’24
Not seeing signposts when profiling a unit test (Xcode 16.1)
While I was recently profiling some code from a Swift library, I noticed that XCTest added in signposts for the measurement tests, which I found really helpful to "home in" on the code I wanted to profile digging around in the stack trace. I tried to add my own signposts to provide just a bit of my own markers in there, but while it compiles and profiles equivalently, the signposts just aren't showing up. This is with Xcode 16.1, macOS Sequoia (15.1) and a swift library, using XCTest and profiling within one of the unit tests. Is there something in this sequence that doesn't allow the library to set up signposts and have instruments collect them? The flow I'm using: import os let subsystem = "MyLibrary" class MyClass { let logger: Logger = .init(subsystem: subsystem, category: "fastloop") let signposter: OSSignposter init() { signposter = OSSignposter(logger: logger) } func goFast() { let signpostId = signposter.makeSignpostID() let state = signposter.beginInterval("tick", id: signpostId) // ... do a bunch of work here - all synchronous signposter.endInterval("tick", state) } } Is there something I'm doing incorrectly in using this API, or not enabling to allow those signposts to be collected by the profiler? I do see the signposts that XCTests injects into the system, just not any of the ones I'm creating.
1
0
763
Nov ’24
ARView example code failing to compile on an M1 Mac & Xcode 12.4?
Hello, I recently downloaded the same from Creating a Game with SceneUnderstanding - https://developer.apple.com/documentation/realitykit/creating_a_game_with_sceneunderstanding, and the out-of-the-box compilation failed, with what appears to be some structural misses in RealityKit. This is with Xcode 12.4 (12D4e) - and a number of compilation complaints appear to be Objective-C elements not being correctly bridged, or otherwise unavailable to the compiler. Missing: ARView.RenderOptions .session within an ARView instance SceneUnderstanding from within ARView.Environment .showSceneUnderstanding from ARView.DebugOptions and a few others. I tried changing the deployment target from iOS 14.0 to iOS 14.4, clean build and rebuild, and wiping out DerivedData just to take a stab at things, but to no avail. Is there something I can/should update to get the scene understanding elements back available from the ARView class?
2
0
1.5k
Feb ’21
Is there an equivalent accessibilityElement API for SwiftUI - specifically when making visualizations using the new Canvas view in SwiftUI
What's the most effective equivalent to the accessibilityElement API when you're creating visualizations in SwiftUI using the new Canvas drawing mechanism? When I'm drawing with Canvas, I'd know the same roughly positioning information as drawing in UIKit or AppKit and making charts visualizations, but I didn't spot an equivalent API for marking sections of the visualization to be associated with specific values. (akin to setting the frame coordinates in a UIView accessibility element) I've only just started playing with Canvas, so I may be wrong - but it seems like a monolithic style view element that I can't otherwise easily break down into sub-components like I can by applying separate CALayers or UIViews on which to hang accessibility indicators. For making the equivalent bar chart in straight up SwiftUI, is there a similar mechanism, or is this a place where I'd need to pop the escape hatch to UIKit or AppKit and do the relevant work there, and then host it inside a SwiftUI view?
3
0
1.6k
Jun ’21