Post

Replies

Boosts

Views

Activity

Reply to Can I add a CKDatabaseOperation to the queue belonging to a CKContainer object using CKContainer.add(_:)?
Concept Assume user A uses the app and CKFetchRecordsOperation.fetchCurrentUserRecordOperation gets executed, user A's record would be returned. User is a system defined record type User A will have access to the following: Public database Private database (if authenticated) Shared database (if authenticated) User B will have his / her own private and shared database. Only user can be logged on to one device at a given time, you can't have 2 iCloud accounts signed on the device (In Settings) So you can only get one record for the current user. Reference: https://developer.apple.com/icloud/cloudkit/designing/ Queue to use For CKFetchRecordsOperation is a subclass of CKDatabaseOperation so you need to use CKDatabase.add If you use CKContainer.add an exception will be thrown *** Terminating app due to uncaught exception 'CKException', reason: 'CKDatabaseOperations must be submitted to a CKDatabase'
Aug ’22
Reply to Drag and Drop using SwiftUI
Environment macOS 13.0 Beta (22A5321d) Xcode 14.0 beta 5 (14A5294e) macOS Single item drag and drop with in app - Works Multiple items drag and drop in a list - Doesn't work - Bug Drag and Drop from one app to another - Works Drag and Drop from app to Finder - Doesn't work (only proxy representation works) - Bug iOS Simulator Single item drag and drop with in app - Works Multiple items drag and drop in a list - Works Drag and Drop from one app to another - Works Drag and Drop from app to Finder - Works
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’22
Reply to How to make Xcode Cloud compile code compiled in Xcode beta ?
Thanks for the reply but I am facing another issue before getting to try your suggestion. While trying to create a workflow I get the following error "<App name>" could not be added to Xcode Cloud The product with Bundle ID (<Bundle ID>) has already been created in this team. Some background details: I was using Xcode cloud before on a Xcode release version Later I upgraded macOS 13.0 Beta and the used Xcode Beta Xcode Cloud workflow was not appearing on Xcode I tried several times and later I think I ended up deleting the workflow on AppStoreConnect Then I tried adding the Xcode error when I face this error Any help would be much appreciated, many thanks!!
Sep ’22
Reply to What build setting causes `PreviewProvider`s to be stripped when archiving?
Your solution to use #if DEBUG <…> #endif however it is not very obvious before reading your post. I am wondering why SwiftPreview structs would ever be included in the archive? I wish Apple could come up with a property wrapper (example: @SwiftUIPreview or @Devlopment) that could be used for previews, that way there might be a way to avoid the inclusion of code marked with this property wrapper in the archive solving this problem.
Sep ’22
Reply to Access Core App Data from IOS widget
Problem: Since app extensions run as part of a host application rather than as part of their containing app (i.e. your app’s extensions run in somebody else’s app), data sharing isn’t automatic. Solution: The preferred way is to track changes (History Tracking) in the app's entities and update into widget's entities.  Refer: https://developer.apple.com/documentation/coredata/consuming_relevant_store_changes Approach: 1.0 - Create App Groups 2.1 - Create separete app entities and widget entities 2.2 - Create separate configurations for app entities and widget entities   2.3 - Assign them configuration to their entities 3.0 - Use app group while creating and loading the container 4.0 - Use history tracking to track changes from the app's entities and update into widget's entites.
Topic: App & System Services SubTopic: General Tags:
Oct ’22
Reply to Why can't i see my widget logs on device?
Xcode 14.1 known issue: Xcode 14.1 release notes seems to mention a known issue After Running a widget extension, users will need to manually start the debugging session with Debug -> Attach to Process. (99285608) Approach (works on simulator and device) Run app target and widget target at the same time Attach debugger to your widget Steps Select app scheme and run on iOS device (don't stop) Select widget scheme and run on iOS (don't stop) So both the targets are running at the same time Select widget scheme then Debug > Attach to Process > Select your widget target name On device / simulator add widget Note: You need to attach the debugger every time you run (Xcode forgets debugger added for the previous run) Now your breakpoints should work as expected and you can debug
Topic: Programming Languages SubTopic: Swift Tags:
Nov ’22
Reply to Xcode Cloud error: Swift Package dependency for app extension
Approch Check if Package.resolved is checked into the repository and is pushed to remote Check if Xcode Cloud has access to your swift packages used in your project Package.resolved Check if <appname>.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved is checked into the repository and is pushed to remote Xcode Cloud Go to AppstoreConnect > choose App name > Xcode Cloud > Select failed build number See the yellow banner with the following message Repository Issue ----------------- Xcode Cloud is unable to connect to the repository “https://github.com/<github username>/<package name>.git”. Reconnect the repository to resume builds. Click Manage Repositories See the following yellow banner with the message: Grant access to the following repositories to allow them to be used for this product. Click Grant button Start build and it should fix the issue
Nov ’22
Reply to Logger messages not showing in XCode console
@eskimo Thanks a lot for the prompt reply, you are right we can filter by subsystem which is great. Upon further investigation I realised these aren't debug messages that got printed, they were errors (not sure why though). When I set the launch arguments as com.apple.CoreData.Logging.stderr 0 (under Scheme > Run > Arguments) I don't get these errors anymore. The only question remaining is why are these errors thrown, I even tried with Xcode > New Project > Checking CloudKit and CoreData checkboxes, even on the new project with generated code these errors are thrown. Tested on device with iCloud turned on, syncing is fine but not sure if I am missing something or this is a internal error within the framework. FB FB11794798 - Feedback contains sample project
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’22