Post

Replies

Boosts

Views

Activity

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 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 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 Logger on Xcode console
Non-sensitive logging (Public) This doesn't work in my following case: import SwiftUI import os struct ContentView: View { let logger = Logger(subsystem: "MyApp", category: "MyCategory") let itemName = "something non-sensitive" var body: some View { Text("Hello, world!") .onAppear { logger.debug("content view displayed") logger.debug("Item name = \(itemName, privacy: .public)") } } }
Nov ’22
Reply to iOS widget always displaying placeholder on simulator or device
It has happened to me a couple of times. Possible causes: 1 It takes a long time for the timeline provider function to provide a timeline. If that is the case then reduce the number of timeline entries and have a reload policy of atEnd 2 Sometimes this happens when using Running the app on device vs TestFlight app version. Delete app and restart phone and install app and then add the accessory widget.
Topic: App & System Services SubTopic: General Tags:
Dec ’22
Reply to how to get console logs for the last 24 hours
OS Log / Logger It is now possible using Apple's unified logging (OS Log / Logger) Refer: https://developer.apple.com/wwdc20/10168 Note: Make sure your device is connected to the Mac either (USB / network) Network would work only if Connect via network is checked Terminal Run the following command on the terminal: sudo log collect --device-name yourdevicename --start '2022-12-01 13:15:00' --output mine.logarchive Here your yourdevicename is your device's name Open file Double clicking the file should open in console
Topic: App & System Services SubTopic: Core OS Tags:
Dec ’22
Reply to How can I view the Development-server private data for my iCloud test account in the CloudKit Dashboard?
@LogicalLight Usually a Apple developer account is different from the Personal Apple account Normally you would only be able to see only your own private data (meaning only the Apple Developer account's data) New Feature Now there is a way to view your personal account's private data by tapping on Act As iCloud Account… You would need to provide credentials and view your personal private data Steps Go to CloudKit Console > Database > Select your container Sidebar would have a link / button called Act As iCloud Account… Tap that and provide credentials for your personal account Thanks to the Apple CloudKit team for this awesome feature without compromising privacy!
Dec ’22
Reply to You can only submit two builds per day to Beta App Review.
Thanks Claude31 for the clarification. External testing vs Internal Testing I suppose there can be any number of internal builds in a day, however only 2 builds can be submitted for review for External testers Errror Xcode Cloud is integrated into Xcode and reports status from AppStoreConnect, IMHO this seems more like a bug where this particular scenario has not been handled. Even AppStoreConnect doesn't actually show the error unless I try to add external testers. The fact that Xcode Cloud attempted to add external testers should have triggered the error in AppStoreConnect but however it doesn't seem to have or at least doesn't display in AppStoreConnect. After that it should be relayed to Xcode I hope the Apple Engineers could have a look at this. Thanks.
Dec ’22