Post

Replies

Boosts

Views

Activity

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 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 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 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 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 How to drag multiple items in a list
@Iomegan For the Mac the issue still exists, iOS works. I have filed a feedback. In case you want to use it on the Mac you could NSItemProvider API, these APIs are older and in my humble opinion that in the future Transferable APIs would gain more capabilities
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’22
Reply to Xcode 14 hangs frequently on Ventura
@satkdev is your Time Machine backup running at that point in time? Also next time this happens go to activity monitor and check network usage
Replies
Boosts
Views
Activity
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!
Replies
Boosts
Views
Activity
Dec ’22
Reply to Weird behavior with NavigationSplitView and @State
@natemartinsf Pass a binding, don't initialise the @State variable from outside
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
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:
Replies
Boosts
Views
Activity
Dec ’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:
Replies
Boosts
Views
Activity
Dec ’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)") } } }
Replies
Boosts
Views
Activity
Nov ’22
Reply to FB11812450: DatePicker on macOS after Esc key is pressed becomes unresponsive / unselectable
Given below is the screen recording: Screen recording of date picker issue
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
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:
Replies
Boosts
Views
Activity
Nov ’22
Reply to Can't search my widgets in physical device.
Your title says "physical device" but description says "simulator". Which one is it? On simulator I have noticed that none of the widgets are listed but when I type few letters of my app then they get listed. You could try that if it is the simulator. If it is the device then I am not sure.
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 Xcode Cloud UI test plans : show attachment previews in test results
You could try checking https://developer.apple.com/documentation/xcode/creating-screenshots-of-your-app-for-localizers
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 Logger messages not showing in XCode console
Thanks a lot will post with CoreData and CloudKit tags
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’22