I cannot figure out how to sort a SwiftData query based on a boolean value. My sort works perfectly well for a string, date, int, etc. But crashes with a boolean.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I have many apps published on the app store however I have one that is saving it's core data under a different one's app name. I don't know how else to describe the issue.
So I have an app called AppB let's say. This app uses CoreData/Cloudkit and works perfect. I also have an app called AppA and it also works very well. However, AppA is saving it's CoreData with the title "AppB".
So under iCloud/Manage iCloud Storage on a device it says "AppB" with AppB's icon even, but is actually AppA's storage.
Everything is working but it obviously confuses customers and I would love to know how this can even happen.
The new ShareLink works great and saves a ton of code but I can't seem to get it to work with an attributedstring even though documentation indicates it should as attributedstring conforms to transferrable.
So for example:
//This works fine.
ShareLink(item: "test")
//But this doesn't.
ShareLink(item: AttributedString("test"))
Error instantly pops up "No exact matches in call to initializer".
I'm creating an iOS app with SwiftUI and everything works great on all platforms including OSX except for the UIActivityViewController. The controller works as expected on iOS but just displays a blank window on OSX that I can't even close. I'm passing simple text to the controller to share via email or printer.Here is the controller struct;struct ActivityViewController: UIViewControllerRepresentable {
var activityItems: [Any]
var applicationActivities: [UIActivity]? = nil
func makeUIViewController(context: UIViewControllerRepresentableContext) -> UIActivityViewController {
let controller = UIActivityViewController(activityItems: activityItems, applicationActivities: applicationActivities)
return controller
}
func updateUIViewController(_ uiViewController: UIActivityViewController, context: UIViewControllerRepresentableContext) {}
}And I present it like this;.sheet(isPresented: $bShare, onDismiss: {
print("Dismiss")
}, content: {
Text("It's Fun to Share")
ActivityViewController(activityItems: ["place holder"])
})
I have a ZStack with top leading alignment. The first child put into it aligns as expected (top leading) but the second child aligns to center. Is this a bug or am I missing something here. ZStack {
HStack {
Text("stack 1")
}
.frame(width: 150, height: 400, alignment: .topLeading)
.background(Color.red)
HStack {
Text("stack 2")
}
.frame(width: 100, height: 200, alignment: .topLeading)
.background(Color.blue)
}
.frame(width: 200, height: 500, alignment: .topLeading)
.background(Color.yellow)