Post

Replies

Boosts

Views

Activity

Reply to Freshly inserted data through REST-request only displayed after reopening the view
Guessing: I think it has something to do with DATA.depot.datapoints. Is Depot a struct or a class? Just remember: Mutating a class property is not considered as a value change. Mutating a struct property is considered as a value change. Testing For testing purpose create a temp @Published var temp dataPoints, update it there and see if your view reacts. If so then it is something with Depot and if it is a struct / class. Possible Workaround You can manually call objectWillChange.send() inside your DataService to indicate the object has changed
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’22
Reply to Freshly inserted data through REST-request only displayed after reopening the view
Are you familiar with data dependencies (source of truth) in SwiftUI? Example @State, @StateObject, @ObservedObject, @EnvironmentObject etc. If anyone of the variables are declared using one of the above, and if their @Published property changes then the views would be refreshed automatically. IMHO it might make sense to go through https://developer.apple.com/wwdc20/10040
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’22
Reply to Cannot debug widget in a watch target using Xcode 14.1
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: App & System Services SubTopic: General Tags:
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
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 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 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 Freshly inserted data through REST-request only displayed after reopening the view
Guessing: I think it has something to do with DATA.depot.datapoints. Is Depot a struct or a class? Just remember: Mutating a class property is not considered as a value change. Mutating a struct property is considered as a value change. Testing For testing purpose create a temp @Published var temp dataPoints, update it there and see if your view reacts. If so then it is something with Depot and if it is a struct / class. Possible Workaround You can manually call objectWillChange.send() inside your DataService to indicate the object has changed
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to XCode Clouds Build Fails: Un-abled to load contents of Pods xcfilelist
Try the following, first need to identify where the problem is. Can you build manually (Product > Archive and export a development build)? If the above is possible then most likely go to AppStoreConnect > Your app > Xcode Cloud > Repositories and see if the permissions have been granted to your dependent repositories?
Replies
Boosts
Views
Activity
Nov ’22
Reply to Freshly inserted data through REST-request only displayed after reopening the view
Are you familiar with data dependencies (source of truth) in SwiftUI? Example @State, @StateObject, @ObservedObject, @EnvironmentObject etc. If anyone of the variables are declared using one of the above, and if their @Published property changes then the views would be refreshed automatically. IMHO it might make sense to go through https://developer.apple.com/wwdc20/10040
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to Cannot debug widget in a watch target using Xcode 14.1
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: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to Getting errors when trying to connect to CloudKit using NSPersistentCloudKitContainer
@mr_fat I am testing on device with iCloud and iCloud Drive turned on yet these errors are thrown in the Xcode debug area. Sync is working fine, but not sure why the errors are thrown. I have tried on a new project by checking CoreData and CloudKit with default code and sync happens fine but these errors are thrown
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
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:
Replies
Boosts
Views
Activity
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
Replies
Boosts
Views
Activity
Nov ’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:
Replies
Boosts
Views
Activity
Nov ’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:
Replies
Boosts
Views
Activity
Oct ’22