Post

Replies

Boosts

Views

Activity

SwiftData and CloudKit
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
9
5
1.6k
Aug ’25
Action Button(Textfield)
Good day, I would like to generate a text field when I tap on the green button that creates a new text field and I can still enter for example a 2nd phone number. I have already tried it with this example: Button(action: { print("Telefonnummer")}) {          Image(systemName: "plus.circle.fill")                 .foregroundColor(Color(.systemGreen)) }
8
0
2.8k
Jan ’22
NavigationLink issue
Good day, I have the problem that when I switch from one view to another, the content is moved to the bottom every time. I have already tried with the: See picture attached: [https://we.tl/t-SUYZZh6M2P) Does anyone have a solution suggestion? Greetings
4
0
1k
Dec ’21
Xcode autosave issue
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?
3
1
1.1k
Sep ’25
How to add DetailView?
Hi everyone, does anyone have a suggestion on how I can add a detail view to this grid view? import SwiftUI struct ContentView: View {     var body: some View {         NavigationView {             List {                 ImageRow()             }.navigationBarTitle(Text("Landscapes"))         }     } } struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()     } } import SwiftUI import Combine struct ImageRow: View {     var body: some View {         var images: [[Int]] = [] _ = (1...18).publisher .collect(2) // Creating two columns             .collect()             .sink(receiveValue: { images = $0 })                  return ForEach(0..<images.count, id: \.self) { array in             HStack {                 ForEach(images[array], id: \.self) { number in                     Image("noaa\(number)")                         .resizable()                         .scaledToFit()                         .cornerRadius(10)                   }             }         }     } }
2
0
900
Apr ’22
Save images in SwiftData
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 } }
2
0
6.9k
Jan ’24
Apple activity ring(sparkle)
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
2
0
877
May ’24
SceneKit
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?
2
0
589
Feb ’25
RealityKit migration
Hey there, I’m currently planning to use RealityKit in a new multiplatform app I’m building. Unfortunately, I noticed that WatchOS is not supported for RealityKit, while SceneKit is getting deprecated. However, I’d like to maintain the same codebase across platforms. What are my options?
2
0
416
Oct ’25
Mapkit Type
Hello, how can I turn this standard map view into a Satellite map view? Thanks //  MapView.swift //  Grindelwald View // //  Created by Roman Indermühle on 15.04.22. // import MapKit import SwiftUI struct City: Identifiable {     let id = UUID()     let name: String     let coordinate: CLLocationCoordinate2D } struct MapView: View {          @State private var region = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: 46.62407, longitude: 8.03434), span: MKCoordinateSpan(latitudeDelta: 0.17, longitudeDelta: 0.17))               let annotations = [         City(name: "Burglauenen", coordinate: CLLocationCoordinate2D(latitude: 46.63649, longitude: 7.97512)),         City(name: "Stalden", coordinate: CLLocationCoordinate2D(latitude: 46.63937, longitude: 7.97216)),         City(name: "Stalden2", coordinate: CLLocationCoordinate2D(latitude: 46.63873, longitude: 7.96684))                       ]               var body: some View {         Map(coordinateRegion: $region, annotationItems: annotations) {             MapMarker(coordinate: $0.coordinate)                                   }                       }      } struct MapView_Previews: PreviewProvider {     static var previews: some View {         MapView()     } }
1
0
1k
Apr ’22