Post

Replies

Boosts

Views

Activity

Linker command failed due to Undefined Symbol errors.
Xcode will build and analyze fine using the Debug build configuration but trying to use Analyze or Archive with Release configuration generates 3 errors: Undefined symbol: protocol conformance descriptor, Undefined symbol: type metadata accessor, and Undefined symbol: nominal type descriptor causing the linker to command to fail. The library is included and already linked and a previous version did not have the error so I think it's a code issue but not quite sure what it is or how to fix! The project/package can be found here: https://github.com/kudit/Device/tree/v2.1.17 (to reproduce, checkout this version and rename appending ".swiftpm" to the folder, then right-click to show package contents, open the Development folder and open the Xcode project there. It's done this way so the package can be imported and edited on iPad Swift Playgrounds)
2
0
673
Jun ’24
How do you include custom symbol resources in a package?
I am trying to include custom symbol resources in a swift package for use in other projects. I have read the documentation here: https://developer.apple.com/documentation/xcode/bundling-resources-with-a-swift-package However there is no example code and I have created a very simple project to try and get this working but it does not. .target( name: "TestLibrary", resources: [.process("Resources/Media.xcassets")] ), This is in the Package.swift file and the path relative to the Package.swift file is Sources/TestLibrary/Resources/Media.xcassets. There's a GitHub project with an example custom SF Symbol SVG (but this may not be available in the future): https://github.com/kudit/TestLibrary Including this as a package in a blank Swift Playgrounds App project and just importing the TestLibrary and including TestImageView() in the ContentView technically works (it shows the system full star image, but none of the ways of rendering the test symbol as recommended works. It does work for a few of the options in the #Preview when viewing the project in Xcode. Anyone have any suggestions or know how to get the resources to be accessible from outside the module? I have tried both the .copy( option as well as the .process( option and neither seem to work.
1
0
754
Apr ’24
Detect relaunch of app from launcher in visionOS.
In macOS, there is applicationShouldHandleReopen. Is there an equivalent in visionOS? How would I detect someone tapping on the app icon in visionOS from the Home Screen? Scenario: User opened my app at work and is now home. The open window of the app is spatially elsewhere so clicking on the app icon does nothing. The user can re-center all views, but that ruins the placement of all windows in all apps. When tapping on the app icon, I'd like to be able to launch a new window that can be placed in the new space. Does anyone know how this can be done?
0
0
520
Mar ’24
Swift Regex crashes when trying to get a simple string
I'm trying to create a simple Regex Builder to parse a timestamp in hh:mm:ss or mm:ss format, a " - " separator, and then a string. I'm trying to use the new Swift RegexBuilder however it doesn't seem to work. It compiles but crashes when running when trying to get the text portion. Example code in a single playground preview file for reference: import SwiftUI import RegexBuilder struct RegexTestView: View { var string: String { let timecode = Regex { Optionally { OneOrMore(.whitespace) } // timecode section Optionally { Capture { OneOrMore(.digit) } transform: { match in Int(match) } ":" } TryCapture { OneOrMore(.digit) } transform: { match in Int(match) } ":" // seconds TryCapture { OneOrMore(.digit) Optionally { // miliseconds "." OneOrMore(.digit) } } transform: { match in TimeInterval(match) } // separator " - " Capture { // WHY CAN'T I GET THE REMAINING TEXT???? Any attempts I make to get this result in a crash. OneOrMore(.any) } transform: { match in String(match) } } let tests = [" 222:45:23.2 - foo","2:34:22 - bar"," 2:08 - baz","2:32.18","2:45:23.2 - what"] var results = "" for test in tests { guard let match = test.wholeMatch(of: timecode) else { results += "MATCH NOT FOUND" continue } results += """ •••• \(match.0) \(String(describing: match.1)) \(String(describing: match.2)) \(String(describing: match.3)) """ /* // Adding this line to the above crashes \(String(describing: match.4))\n */ } return results } var body: some View { Text(string) } } #Preview("Regex") { RegexTestView() }
1
0
633
Nov ’23
iCloud reminders issue
So right after the keynote on Monday, my reminders app decided to partly upgrade and I can’t see any of my reminders on my device. Has anyone else had this issue? I waited until iOS 14.5 came out to do the iOS 13 upgraded reminders feature and when I tried to it kept failing. It looks like a month later it finally decided to do something but now the upgrade button is gone and there is an exclamation point warning next to my reminders lists and two items saying “Where are my reminders?” And “The creator of this list has upgraded these reminders.” (I am the creator)
0
0
880
Jun ’21
How can I order Reminders tasks?
Does anyone have any idea how to modify the manual order of reminders in the Reminders.app using Swift? I have gotten to a point where I can get a reminders list and move them to other lists by changing the .calendar property, however even if I move them in reverse order (move Task 2 and then move Task 1), they appear in the second list in Task 1 then Task 2 order. I suspect there is some property indicating the order or weight. When I used JXA (https://developer.apple.com/forums/thread/649653) to duplicate an item from the middle of one list to another list (which actually moved instead of duplicating due to a bug I imagine), it appeared in the middle of the destination list and not at the end. As a workaround, I'd be even okay if there was a way to UI script, however, I can't find a way to re-order rows via UI scripting.
0
0
596
Jun ’20
Copy file from ~/Library/Safari
I am trying to copy the LastSession.plist file for backup from the ~/Library/Safari folder. I have a launchd daemon that I'm using to make the copy and other backup tasks overnight, however, it gives an error when it tries to copy files from this folder. It works if I run the script from the command line however it doesn't work when executed by launchd. How can I give the script permission to copy from this folder on a schedule?
1
0
903
Jun ’20