Post

Replies

Boosts

Views

Activity

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 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 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
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 How to make Xcode Cloud compile code compiled in Xcode beta ?
@rafael160 Edit WorkFlow > Environment and set the following Xcode Version select Latest Beta or Release macOS Version select Latest Beta or Release
Replies
Boosts
Views
Activity
Nov ’22
Reply to NavigationSplitView sidebar Links not working after navigating back
Works fine on Xcode 14.1 simulator
Topic: UI Frameworks SubTopic: SwiftUI Tags:
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