Hey there,
I’m currently exploring the possibility of integrating Sign in with Apple into my iOS app and backend.
Regarding the iOS app, I’ve read that when a user is signed in, you always need to call getCredentialState on the app’s launch. Is this true? If so, how is it possible to sign the user out then?
I intend to incorporate SwiftData and CloudKit into my application. In light of this, I’m curious about your approach to user management. Specifically, I’m wondering if you would store the user’s data in a Redis database after successful authentication on the backend. Or, would you separate the user data and save it using SwiftData/ CloudKit?
Post
Replies
Boosts
Views
Activity
Helle there
Currently, I’m attempting to create an interactive learning application with a 3D view. I’ve discovered the framework SceneKit, but I lack the necessary knowledge to animate, load and moving objects. Could someone kindly suggest some good articles or tutorials on this topic?
Recently I noticed that when I build and archive my app with Xcode Cloud, it fails due to code signing issue. But that's weird because I have all development and distribution certificates. Does anyone have any idea how to solve this?
Recently I've been working on a demo project called iLibrary. The main goal was to learn more about CloudKit and SwiftData. After a while I noticed that there were some hangs/freezes when running the app in debug mode.
I first tried this with Xcode 15.4 and iOS 17.5. Here the hang only appears at the beginning, but only for a few seconds. But when I exit debug mode, there are no more hangs.
With Xcode 16 beta 4 and iOS 18 it looks completely different. In this case, the hangs and freezes are always present, whether in debug mode or not. And it's not just at the beginning, it's throughout the app. I'm aware that this is still a beta, but I still find this weird. And when I profile this I see that the main thread gets quite overloaded. Interestingly, my app doesn't have that many operations going on. So I guess something with the sync of SwiftData or my CloudKitManger where I fetch some records from the public database is not running fine.
Lastly, I wanted to delete the iCloud app data. So I went to Settings and tried to delete it, but it didn't work. Is this normal?
Does anyone have any idea what this could be? Or has anyone encountered this problem as well? I'd appreciate any support.
My project: https://github.com/romanindermuehle/iLibrary
I am currently working on an app that utilizes SwiftData, and I am planning to integrate CloudKit. My current challenge involves managing a Day object that gets inserted when the date changes to track daily progress. Additionally, I want to prompt users to create a username during the app's onboarding process. I am concerned that this could lead to synchronization issues, such as duplicate entries for the same day or multiple user accounts being created. I assume blocking the app until everything is synced from CloudKit is not a practical solution. Does anyone have any recommendations on how to handle this?
Furthermore, I would like to implement a community feature where users can post content. I noticed that CloudKit offers a public database. Is this database suitable for such a feature, or would I need to develop a separate backend to support it?
When I parse the query result(SwiftData) to my DetailView it works fine. But when I delete the item in the DetailView the view isn't updated.
I parse the array from the dataModel to the DetailView. But I do not understand why it's not updating when I add or delete a tree in the DetailView. Only when I append the tree to the array from the other model after insert it works.
Does someone have a tip for me?
Here is my Code: https://gist.github.com/romanindermuehle/14441c21f689e91b26942d997f75300d
Hello everyone, I looked at various methods how to Unit/UITest SwiftData but I couldn't find something simple. Is it even possible to test SwiftData? Does someone found a solution for that?
Hello everyone
My goal is to create Apple's activity ring sparkle effect. So I found Paul Hudson's Vortex library. There is already a sparkle effect, but I don't know how to modify it to achieve my goal. Because I'm pretty new to SwiftUI animations. Does anyone have any idea how I could do this?
Vortex project: https://github.com/twostraws/Vortex
My goal is to create Apples activity ring sparkle effect. So I found Paul Hudson's Vortex library. There is already a spark effect, but I don't know how to create a custom one that fits my needs. I'm still quite new to SwiftUI animations. Does someone have an idea how to do it?
VortexView(createSparkle()) {
Circle()
.fill(.white)
.frame(width: 16)
.tag("circle")
}
func createSparkle() -> VortexSystem {
let system = VortexSystem(tags: ["circle"])
system.birthRate = 150
system.emissionDuration = 0.2
system.idleDuration = 0.5
system.lifespan = 1.5
system.speed = 1.5
system.speedVariation = 0.2
system.angle = .degrees(330)
system.angleRange = .degrees(30)
system.acceleration = [0, 3]
system.dampingFactor = 4
system.colors = .ramp(.white, .yellow, .yellow.opacity(0))
system.size = 0.1
system.sizeVariation = 0.1
system.stretchFactor = 8
return system
}
Vortex project: https://github.com/twostraws/Vortex
Lately, I keep getting this warning when closing Xcode asking if I want to save the changes. Strangely enough, I have never received this before. I looked to see if I could disable and enable autosave. Unfortunately I have not found anything. Does anyone have any tips?
Hello everyone,
How do I need to handle the delete with the relationship deny? When I delete a model that still has a reference to another model, it deletes it from the UI. But when I re-run the simulator, it's back again. Does someone have a hint for me?
How is it possible to ensure the uniqueness of the entries? Because I saw that the Attribute unique can't be used with CloudKit.
Hello everyone
I tried to upload my playground app via Xcode to AppStore Connect. Unfortunately it didn’t worked. I tried everything what the error suggested me to do. But its still not working. Has anyone ever encountered this error?
I started playing around with the navigationDestination modifier. But currently it always re-routes me back to the list with the entries. Does someone have an idea why this happens?
MainView
NavigationStack {
Form {
Section {
ProgressRing(percentage: $percentage)
Text("1 of 3 compleatet")
.font(.title2)
.fontWeight(.medium)
.foregroundStyle(Color.accentColor)
}
.listRowBackground(Color.clear)
.listRowSeparator(.hidden)
.frame(maxWidth: .infinity ,alignment: .center)
.padding()
Section("Daily tasks") {
NavigationLink {
EmptyView()
} label: {
Label("Log mood", systemImage: "seal")
}
NavigationLink {
QuoteView()
} label: {
Label("Quote Gallery", systemImage: "seal")
}
NavigationLink {
GratitudeListView()
} label: {
Label("Writing down gratitude", systemImage: "seal")
}
}
}
.navigationTitle("Hello, \(users.first?.name ?? "User")")
}
List {
ForEach(gratitudes, id: \.self) { gratitude in
NavigationLink(value: gratitude) {
VStack(alignment: .leading) {
Text(gratitude.gratitude1)
Text(gratitude.createdAt, style: .date)
}
}
}
.navigationDestination(for: Gratitude.self, destination: { gratitude in
GratitudeUpdateView(gratitude: gratitude)
})
}
.navigationTitle("Gratitude")
.toolbar(.hidden, for: .tabBar)
.overlay(alignment: .bottom) {
NavigationLink {
GratitudeAddView()
} label: {
PlusButton()
}
}
Hello everyone,
Is there a better solution than my approach out there to convert an image to data and back?
@Model
class User {
var name: String
@Attribute(.externalStorage) var image: Data?
var createdAt: Date
init(name: String, image: Data, createdAt: Date = .now) {
self.name = name
self.image = image
self.createdAt = createdAt
}
}
if let selectedPhotoData = imageData,
let uiImage = UIImage(data: selectedPhotoData) {
Image(uiImage: uiImage)
.resizable()
.scaledToFill()
.frame(width: 300, height: 300, alignment: .center)
.clipShape(Circle())
}
.task(id: selectedPhoto) {
if let data = try? await selectedPhoto?.loadTransferable(type: Data.self) {
imageData = data
}
}
Hello everyone,
Is there a way to set the minimum deployment target in Xcode Playground?