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
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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))
}
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
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?
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?
Topic:
Developer Tools & Services
SubTopic:
Xcode Cloud
Tags:
Signing Certificates
Code Signing
Xcode Cloud
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)
}
}
}
}
}
Hello together,
I'm currently learning CoreData, but my preview in Xcode crashes always when I try to add something new to the view. Does someone have an idea what I need to pass to the preview that it works?
My code
Hello everyone,
Is there a way to set the minimum deployment target in Xcode Playground?
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
Tags:
Swift Playground
Swift Student Challenge
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
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
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?
Hey everyone,
Is it possible to generate XML using the “Generable” macro of the Foundation Model Framework?
Topic:
Machine Learning & AI
SubTopic:
Foundation Models
Hey there, does someone know why the ContentUnavailableView is behaving differently on iOS 26 than in iOS 18 but the code is the same?
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?
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()
}
}