I had the same issue, the bug still exists. But you can go to "Signing & Capabilities" in Xcode. Uncheck the "CloudKit" button under the iCloud section, save the project and check the button again. Then choose your container again. That fixes the issue. Additionally make sure that the name of your model doesn't already exist in your container as a RecordType to prevent unexpected errors again.
Post
Replies
Boosts
Views
Activity
Hello :)
I think the completionHandler with the option .banner might be a problem. Banners disappear after a few seconds no matter if the application is running or not. I can't test it right now, but it might work with completionHandler([.alert, .badge, .sound]).
Hello :)
okay, that‘s interesting, thank you for the information :)
Maybe when you test it on another device it might work without performing that settings action. Furthermore you should completely delete and reinstall the application after changing the completionHandler method. Maybe you have done that already, otherwise you can try it. All in all there must be a way, because it has to work programmaticly.
Hello :)
SwiftData only supports primitive types (Int, Bool, ...) currently, so there is no possibility to save a color itself at the moment. In order to save a color you can choose different approaches.
For example, you could define a SwiftData Model to save the different values of red, green, blue and alpha like this:
final class ColorModel {
var red: CGFloat
var green: CGFloat
var blue: CGFloat
var alpha: CGFloat
init(red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat) {
self.red = red
self.green = green
self.blue = blue
self.alpha = alpha
}
}
Then you can display your colors through the following code (simplified here in a ForEach(), has to be adjusted):
ForEach(colors, id: \.self) { color in
Color(UIColor(red: color.red, green: color.green, blue: color.blue, alpha: color.alpha))
}
If you have any further questions, don't hesitate to ask.
I hope I was able to help you.
Hello Andrea :)
there seems to be a problem with the certificates. Try to go to the top left corner, click "Xcode", then go to "Settings" and then choose "Accounts".
Your Apple-ID should be listed there. Click the button "Download Manual Profiles".
Try to restart Xcode. Maybe it is working then.
I hope, this might help.
That's awesome! You don't need to close this thread, it might be a problem for other developers. Then they can see a possible solution too. If there are any further questions, don't hesitate to ask :)
Hello :)
you can check this post, someone else had the exact same issue. If you have further questions, don’t hesitate to ask :)
Hello :)
You just need to embed your whole VStack (so everything inside the var body: some View {}) into a NavigationStack, then it works.
If you have further questions, don't hesitate to ask :)
Hello :)
Here is the link for the CloudKit Console. There you can manage all your iCloud stuff like containers.
There is still no way to delete CloudKit containers. So the only opportunity is to hide them as you already did.
If you have further questions, don't hesitate to ask :)
Hello :)
Can you share the piece of code to see where the problem might appear? Do you save the information locally or synchronized with CloudKit?
Hello :)
Yes, both syntaxes are equivalent. The only difference is that if a>b, c>d is evaluated as two separate expressions and if a>b && c>d is treated as one whole expression :)
Hello :)
That's a really interesting question. I tried many things but I only found two different approaches.
The problem is, you don't get the form's height itself in any way because a form always takes as much vertical space as it gets.
So that's why you could fix the height of the image, so that there is enough space for the form with its content. The drawback of this solution is, that if the content in the form gets more and more, it's not visible anymore when it gets too much. It would be something like:
Image(systemName: "gear")
.resizable()
.scaledToFit()
Form {
Section("section 1") {
Text("text 1")
Text("text 2")
Text("text 3")
}
Section("section 2") {
Text("text 1")
Text("text 2")
Text("text 3")
}
}
.scrollDisabled(true)
.frame(height: 500) //added the .frame() modifier
Another approach would be to not use the Form. By using a normal VStack with the .layoutPriority() modifier the image gets maximized dynamically and the VStack adjusts its height itself. The advantage is that you can fill the VStack with any content you want and the image resizes itself. Example would be:
Image(systemName: "gear")
.resizable()
.scaledToFit()
VStack {
ForEach(1..<9) { value in
HStack {
Text("Test + " + value.description)
Spacer()
}
.padding(.leading)
.padding(.bottom, 4)
}
}
.layoutPriority(1) //very important, otherwise it won't work
Maybe someone else found another solution but I think the second approach might be the best way to start in order to see everything good and adjusted on any device.
If you have any further questions, don't hesitate to ask :)
Hello :)
I don’t have a solution for that but I had the exact same issue. It uploaded after I deleted the previews and tried it again but I think you might have already tried that.
Hello :)
One opportunity might be to connect your iPhone to your Mac. Simply by choosing your iPhone as a run device and executing, Xcode will install your application on your device. After that you can use your application. If you have any further questions, don’t hesitate to ask :)
Hello :)
I would recommend you to use the .environment(). Therefore you create one instance of your ViewModel in order to handle it through the hierarchy to be accessible whenever it is necessary. Apple shows us with this example:
@main
struct BookReaderApp: App {
@State private var library = Library()
var body: some Scene {
WindowGroup {
LibraryView()
.environment(library)
}
}
}
And for the LibraryView():
struct LibraryView: View {
@Environment(Library.self) private var library
var body: some View {
List(library.books) { book in
BookView(book: book)
}
}
}
You can find more information here.
If you have any further questions don’t hesitate to ask.