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.
Post
Replies
Boosts
Views
Activity
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
Seems to work now that there’s a new version of Swift Playgrounds out that recognizes both xrOS and visionOS compiler flags.
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")
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.
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()
}
Works on macCatalyst, made for iPad, visionOS, and iOS but doesn't seem to be fixed on tvOS, macOS, watchOS 🙁.
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.
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
Is there still no supported way to get this?
I agree that this is problematic for users who expect to see an accurate battery level yet it differs from what is shown on screen leading to complaints of accuracy but it seems this is out of our control.
The thing I missed was that in addition to all the information on the In App Purchase section, you have to select the IAPs to attach on the product page (the page where you enter the description and select a binary). The IAPs have to be selected like you select the binary. Easy to miss and Apple isn’t good about explaining that In their rejection.
I'm getting the same error "UIScene property of UINSSceneViewController was accessed before it was set." 3 times in the console when I run the following targeting My Mac (Mac Catalyst). I do not get the error in the iPhone 15 Pro simulator or when running targeting My Mac (Designed for iPad) so I think it might be a bug.
struct ContentView: View {
@State var testIsPresented = false
var body: some View {
NavigationView {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundColor(.accentColor)
}
.toolbar {
Menu("Test") {
Button("Show Sheet") {
testIsPresented = true
}
}
.sheet(isPresented: $testIsPresented) {
Button("Dismiss") {
testIsPresented = false
}
}
}
}
}
}
I'm having a similar issue. Did anyone ever figure this out?
Did you ever find a solution to this?