Posts

Post marked as solved
3 Replies
1.3k Views
Not sure what I'm doing wrong here. I'm taking this opportunity to add persistence to an app that hadn't had it yet. I followed the session advice but I get this crash when running it: SwiftData/BackingData.swift:201: Fatal error: expected attribute to be Codable The crash is on this line: modelContext.insert(RentSplitDataModel()) The object being created and inserted there is simple and the compiler confirms it does conform to Codable: https://github.com/KyLeggiero/Rent-Split-for-iOS/blob/feature/MVP/Shared/Model/RentSplitDataModel.swift
Posted Last updated
.
Post not yet marked as solved
1 Replies
513 Views
At 72 seconds in, the speaker says "This is a code-along. During this session, I will be building an app with you. Hit pause now, and download the companion Xcode projects: an archive with the prepared starting point, and the finished one." However, I cannot find these projects. I see a description, some links to other pages like these forums, some related videos, the transcript, and a series of code snippets displayed in the video, but no project files.
Posted Last updated
.
Post not yet marked as solved
3 Replies
3.4k Views
Original question here: https://stackoverflow.com/q/59280263/3939277I'm writing a simple Mines app to help me get to know SwiftUI. As such, I want primary click (usually LMB) to "dig" (reveal whether there's a mine there), and secondary click (usually RMB or 2-finger click) to place a flag.I have the digging working! But I can't figure out how to place a flag, because I can't figure out how to detect a secondary click.Here's what I'm trying:BoardSquareView( style: self.style(for: square), model: square ) .gesture(TapGesture().modifiers(.control).onEnded(self.handleUserDidAltTap(square))) .gesture(TapGesture().onEnded(self.handleUserDidTap(square)))As I implied earlier, the function returned by `handleUserDidTap` is called properly on click, but the one returned by `handleUserDidAltTap` is only called when I hold down the Control key. That makes sense because that's what the code says... but I don't see any API which could make it register secondary clicks, so I don't know what else to do.I also tried this, but the behavior seemed identical:BoardSquareView( style: self.style(for: square), model: square ) .gesture(TapGesture().modifiers(.control).onEnded(self.handleUserDidAltTap(square))) .onTapGesture(self.handleUserDidTap(square))
Posted Last updated
.
Post not yet marked as solved
1 Replies
922 Views
I've asked Apple Developer Support, regular Apple Support, and high-level Apple Support. They all said to ask here. I am a senior software engineer working on a Photos Extension. I have multiple machines on which I want to test my code. Photos requires that its Extensions operate through Projects. For instance, one might right-click an album and create a new Book or Calendar. Our Photos Extension properly uses the Photos and PhotosUI APIs to manipulate these projects, and Photos takes care of serializing our changes. I am developing Motif for multiple versions of macOS (High Sierra, Mojave, and Catalina). To do so, I have multiple Macs, each with a different OS installed on it.One of the things that I want to fix is a problem that we see when upgrading from Mojave to Catalina. One way I could do this is to install macOS Mojave on one of the Macs, create a project, and then update that Mac to Catalina. This, however, is very time-consuming. Instead, I would like to create a project in Photos on a Mac running macOS Mojave, export that project (say, to a thumb drive), and import it into Photos on a Mac running macOS Catalina.Since there is no UI for exporting a project, I want to know where these projects are stored in the filesystem. I intend to then copy those project files (say, via a thumb drive) between Macs in order to perform these tests. Could you please help me achieve this?
Posted Last updated
.