Post

Replies

Boosts

Views

Activity

RealityKit not behaving as expected
This week, I developed a small multiplatform RealityKit project. I also created a demo scene in Reality Composer Pro. Afterward, I imported the local package into the project. Running the project on macOS works perfectly. However, when I tried to run it on my iPhone, I encountered a permission error indicating that it couldn’t read the package. This seems unusual to me because I assumed that the dependency is bundled into the binary file. In an attempt to resolve the issue, I pushed the RCP package to GitHub, hoping it would work. Fortunately, everything compiles successfully now, but the loading time is significantly long, and the animations don’t play on tap gestures. Could someone please help me identify the root cause of this problem?
1
0
331
Jul ’25
Image cropping
Currently, I’m working on developing a small macOS utility tool for my photography. In my camera, I have a digital zoom feature. I prefer using this feature when I shoot both JPEG and DNG files. While the JPEG is already cropped to the desired format, the DNG file contains metadata (DefaultUserCrop: 0.22, 0.22, 0.78, 0.78). For instance, when I open that DNG file in Lightroom, it pre-crops the image non-destructively. However, I prefer using Pixelmator Pro for editing. Unfortunately, Pixelmator Pro doesn’t have this feature. So, I thought I could create an app that allows me to pre-crop the image for editing in Pixelmator Pro afterward. Does someone have a better idea or some hints on how I could solve it?
1
0
217
Jul ’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
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
ListView with personal data
I will briefly explain my view. My goal is to make a list where you can enter all personal information like a kind of emergency passport. There should also be text fields where you can tap on the plus button and then there is a new text field. On the top right I want to make an edit button that you can delete text fields again. I will connect this view with another SwiftUI view file. Does anyone have an idea how to solve this problem with the list? import SwiftUI struct ListeDaten: Identifiable { let id = UUID() let Name: String let Adresse: String var Telefonnummern: [String] = [] var Something: String = "" } struct ListeDaten: View {     var body: some View {                  TextField(Name: "Name/Vorname")         TextField(Adresse: "Adresse")         ForEach(id: \.self) {Telefonnummern in TextField("Telefonnummer")}         Button(action: {             Telefonnummern.append("")         })         {             Image(systemName: "plus.circle.fill")                 .foregroundColor(Color(.systemGreen))         }     } } struct ListeDaten_Previews: PreviewProvider {     static var previews: some View {         ListeDaten()     } }
0
0
684
Jan ’22
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
AR quick look
Hello, I want to implement AR quick look to my app. I' don't want to use UIKit but SwiftUI. In one of my views, I want to press a button named "preview" and then it should open the AR quick look. Have someone an idea how I can do that? Sorry for that badly formatted code below. import UIKit import QuickLook import ARKit class ViewController: UIViewController, QLPreviewControllerDataSource { override func viewDidAppear(_ animated: Bool) { let previewController = QLPreviewController() previewController.dataSource = self present(previewController, animated: true, completion: nil) } func numberOfPreviewItems(in controller: QLPreviewController) -> Int { return 1 } func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem { guard let path = Bundle.main.path(forResource: "myScene", ofType: "reality") else { fatalError("Couldn't find the supported input file.") } let url = URL(fileURLWithPath: path) return url as QLPreviewItem } } [https://developer.apple.com/documentation/arkit/previewing_a_model_with_ar_quick_look)
0
0
1k
Apr ’22
AR quick look integration
Hello, I struggling to integrate this code below in my Content View can someone give me help? import UIKit import QuickLook import ARKit class ViewController: UIViewController, QLPreviewControllerDataSource {     override func viewDidAppear(_ animated: Bool) {         let previewController = QLPreviewController()         previewController.dataSource = self         present(previewController, animated: true, completion: nil)     }     func numberOfPreviewItems(in controller: QLPreviewController) -> Int { return 1 }     func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem {         guard let path = Bundle.main.path(forResource: "myScene", ofType: "reality") else { fatalError("Couldn't find the supported input file.") }         let url = URL(fileURLWithPath: path)         return url as QLPreviewItem     } }
1
0
1.4k
May ’22
Swift Playgrounds
Hi everyone At the moment I try to use augmented reality QuickLook in Swift playgrounds When I try to open the reality file from the resource folder, this error shows up. Have someone an idea to fix that problem? Thanks in advance import QuickLook import RealityKit import ARKit struct ARQLViewController: UIViewControllerRepresentable {     func makeUIViewController(context: Context) -> some UIViewController {         return UINavigationController.init(rootViewController: ViewController())     }     func updateUIViewController(_ uiViewController: UIViewControllerType, context: Context) {} } class ViewController: UIViewController, QLPreviewControllerDataSource {     var isAppeard: Bool = false     override func viewDidLoad() {         super.viewDidLoad()         DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {             let previewController = QLPreviewController()             previewController.dataSource = self             self.present(previewController, animated: true, completion: nil)         }     }    override func viewDidAppear(_ animated: Bool) {         guard !isAppeard else { return }         isAppeard = true         }     func numberOfPreviewItems(in controller: QLPreviewController) -> Int { return 1 }     func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem {         guard let path = Bundle.main.path(forResource: "SipARAnimation", ofType: "reality") else { fatalError("Couldn't find the supported input file.") }         let url = URL(fileURLWithPath: path)         return url as QLPreviewItem     } }
0
0
860
Feb ’23
SwiftData
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() } }
0
0
589
Jan ’24
SwiftData deleteRules & uniqueness
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.
1
0
795
Apr ’24
Sparkle ring animation
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
0
0
562
Apr ’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