Post

Replies

Boosts

Views

Activity

Reply to Set filename to use for "Save to Files" with ShareLink?
That kinda helps however, the function that generates the transferrable data is a static function meaning that the filename most appropriate for the data is not available to the wrapper... Also, the new link to that method is: https://developer.apple.com/documentation/coretransferable/transferrepresentation/suggestedfilename(_:)-2yln2
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’24
Reply to Problem decoding AttributedString containing emoji
So I was putting together a bug report when I realized the reason it was working in macOS was because I was using a web view and not the NSAttributedString. Here is a very simple example that shows the issue that you may be able to find out why it's not converting. It could be in the HTML attributing of the string... import SwiftUI struct ContentView: View { let html = "<html><head><meta name=\"viewport\" content=\"width=device-width\" /></head><body style=\"font-family: -apple-system;color: rgb(255,255,255);\"><p>Feature Answer 5</p><p><strong>This should be bold</strong></p><p><em>This should be italic</em></p><blockquote><p>Happy Christmas emoji should be supported! 🎅🎄🎁 😉</p></blockquote></body></html>" var attributedString: AttributedString { let data = Data(html.utf8) if let attributedString = try? NSAttributedString(data: data, options: [.documentType: NSAttributedString.DocumentType.html], documentAttributes: nil) { return AttributedString(attributedString) } else { return "Unable to pull NSAttributed string from data." } } var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") Text(attributedString) } .padding() } } #Preview { ContentView() }
Topic: App & System Services SubTopic: General Tags:
Jun ’24
Reply to How do you include custom symbol resources in a package?
Okay, I think I figured it out. Change the .target to be this and it seems to work by calling the bundle version of Image initializers: .target( name: "TestLibrary", resources: [.process("Resources")] ), // test.svg was included as a symbolset Image("test", bundle: Bundle.module) Note that this code only works from within the module so the specific symbol needs to be exposed in Image form rather than as a string.
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’24
Reply to Getting started with PHP ..
I use XAMPP to create a PHP/Apache/MySQL server since Apple stopped bundling it with the system. I really wish there was easier bridging so I can switch over to using Swift instead of PHP...
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’25
Reply to Swift Playgrounds 4.6 removes support for libraries?
They said 4.6.4 would remove the errors, however, #Previews still do not work when including modules with included app executable targets. Apparently Swift Playgrounds is not choosing the correct root app.
Replies
Boosts
Views
Activity
Jun ’25
Reply to Swift Playgrounds 4.6 removes support for libraries?
Are there any updates here?
Replies
Boosts
Views
Activity
May ’25
Reply to Swift Playgrounds 4.6 removes support for libraries?
This worked for Swift Playground 4.6.2, but starting in Swift Playground 4.6.4 whenever this package is included in another swift playground, the new playground silently fails compilation (will not show previews). Works fine in Xcode and worked fine in 4.6.2 and 4.6.3... (issue reported under FB17377610)
Replies
Boosts
Views
Activity
Apr ’25
Reply to Set filename to use for "Save to Files" with ShareLink?
That kinda helps however, the function that generates the transferrable data is a static function meaning that the filename most appropriate for the data is not available to the wrapper... Also, the new link to that method is: https://developer.apple.com/documentation/coretransferable/transferrepresentation/suggestedfilename(_:)-2yln2
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to Linker command failed due to Undefined Symbol errors.
Found a workaround/solution: There was a class that I wanted internal, but making it public silenced the compiler warnings in the RELEASE configuration. Hope this helps someone.
Replies
Boosts
Views
Activity
Oct ’24
Reply to Linker command failed due to Undefined Symbol errors.
Still happening in version 2.2.2 which has been tested by Swift Package Index as free from errors and concurrency issues so I'm now thinking this may be a bug in Xcode... https://github.com/kudit/Device/tree/v2.2.2
Replies
Boosts
Views
Activity
Jul ’24
Reply to Swift Playgrounds warning when containing visionOS conditional code.
Seems to work now that there’s a new version of Swift Playgrounds out that recognizes both xrOS and visionOS compiler flags.
Replies
Boosts
Views
Activity
Jun ’24
Reply to External macro implementation type could not be found for macro 'stringify'
My solution was that I had the following: public macro CreateCustomType() = #externalMacro(module: "CustomType", type: "CreateCustomTypeMacro") And changing to this (the .macro target name) fixed it: public macro CreateCustomType() = #externalMacro(module: "CustomTypeMacros", type: "CreateCustomTypeMacro")
Replies
Boosts
Views
Activity
Jun ’24
Reply to "UIDevice.current.batteryLevel" is always "0" in macOS Sonoma 14.4
I'm seeing the same messages in macOS Sonoma 14.5. Wondering what is causing it as the battery level is getting fetched properly and the message is triggered when plugging/unplugging the device.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to Problem decoding AttributedString containing emoji
So I was putting together a bug report when I realized the reason it was working in macOS was because I was using a web view and not the NSAttributedString. Here is a very simple example that shows the issue that you may be able to find out why it's not converting. It could be in the HTML attributing of the string... import SwiftUI struct ContentView: View { let html = "<html><head><meta name=\"viewport\" content=\"width=device-width\" /></head><body style=\"font-family: -apple-system;color: rgb(255,255,255);\"><p>Feature Answer 5</p><p><strong>This should be bold</strong></p><p><em>This should be italic</em></p><blockquote><p>Happy Christmas emoji should be supported! 🎅🎄🎁 😉</p></blockquote></body></html>" var attributedString: AttributedString { let data = Data(html.utf8) if let attributedString = try? NSAttributedString(data: data, options: [.documentType: NSAttributedString.DocumentType.html], documentAttributes: nil) { return AttributedString(attributedString) } else { return "Unable to pull NSAttributed string from data." } } var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") Text(attributedString) } .padding() } } #Preview { ContentView() }
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to Problem decoding AttributedString containing emoji
Works on macCatalyst, made for iPad, visionOS, and iOS but doesn't seem to be fixed on tvOS, macOS, watchOS 🙁.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to How do you include custom symbol resources in a package?
Okay, I think I figured it out. Change the .target to be this and it seems to work by calling the bundle version of Image initializers: .target( name: "TestLibrary", resources: [.process("Resources")] ), // test.svg was included as a symbolset Image("test", bundle: Bundle.module) Note that this code only works from within the module so the specific symbol needs to be exposed in Image form rather than as a string.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to "UIDevice.current.batteryLevel" is always "0" in macOS Sonoma 14.4
I'm having the same issue! Also reporting the following in the console (not sure if it's related): CLIENT ERROR: TUINSRemoteViewController does not override -viewServiceDidTerminateWithError: and thus cannot react to catastrophic errors beyond logging them
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Mar ’24
Reply to How do I get device model, for example MC769LL/A (needed for iOS 8 and above)
Is there still no supported way to get this?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’24