Post

Replies

Boosts

Views

Activity

Reply to Bonjour for discovering a specific device's ip
Hi there, I struggle to get the mDNS name using _services._dns-sd._udp on iOS 26.1. I tried two methods: NetServiceBrowser always gives me ["NSNetServicesErrorCode": -72008 (missingRequiredConfigurationError), "NSNetServicesErrorDomain": 10] DNSServiceBrowser fails with NoAuth I also tried NWBrowser, but learned that it does not work with _services._dns-sd._udp. My Info.plist: <key>NSBonjourServices</key> <array> <string>_services._dns-sd._udp</string> </array> <key>NSLocalNetworkUsageDescription</key> <string>mDNS_Browser needs to have network access to search for Multicast services</string> I tested it with a physical device, none of the above methods work. The strange thing is that NSBonjourServices works in the simulator the first time I use it but then fails, DNSServiceBrowser does not work. But with macOS 17 DNSServiceBrowser works but NSBonjourServices does not. This is so random, I am out of ideas. Here is an example project that can be used to test both methods: GitHub @DTS Engineer :)
2w
Reply to TipKit: showing a popover tip on a SwiftUI toolbar button
Thanks, but it doesn't seem to be a workaround anymore. :( import TipKit struct ContentView: View { struct ExampleTip: Tip { var title: Text { Text("title") } var message: Text? { Text("message") } } var body: some View { Text("Hello world") // .popoverTip(NewSnippetTip()) //This works .toolbar(content: { ToolbarItemGroup(placement: ToolbarItemPlacement.bottomBar) { Button(action: {}) { Label("New Snippet", systemImage: "doc.badge.plus") } .buttonStyle(.plain) // WORKAROUND: Adding this line does NOT fix the issue. .popoverTip(ExampleTip()) } }) } }
Topic: App & System Services SubTopic: General Tags:
Sep ’23
Reply to Xcode 12.0 B2 SwiftUI - Bottom toolbar after List in ContentView no longer displays.
You could als just use ToolbarItemGroup: struct ContentView: View {   var body: some View {     NavigationView {       List {         ForEach (1..<10) {           row in           Text("\(row) - Test").foregroundColor(Color.white).fontWeight(.bold)         }         .listRowBackground(Color.burgundy)       }             .navigationTitle(Text("List Background Color Test"))       .navigationBarTitleDisplayMode(.inline)       .toolbar {         ToolbarItemGroup(placement: .bottomBar) {           HStack {             Button(action: {}, label: {               Text("One").foregroundColor(Color.white)             })             Spacer()             Button(action: {}, label: {               Text("Two").foregroundColor(Color.white)             })             Spacer()             Button(action: {}, label: {               Text("Three").foregroundColor(Color.white)             }).foregroundColor(.blue)           }         }       }           }               } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’21
Reply to Shortcuts Action with File parameter as input conflicts with Sandbox
Hi there, yes I do receive the file from the input and I've also figured out how to access the file with the Sandbox enabled:     func handle(intent: ExamplePDFIntent, completion: @escaping (ExamplePDFIntentResponse) -> Void) {         if let files = intent.files, {             var outputFiles = [INFile]()             for file in files {                 if file.fileURL!.startAccessingSecurityScopedResource() { //do your work here file.fileURL!.stopAccessingSecurityScopedResource() } else { //don't forget error handling } } } } So we have to use security scopes: https://developer.apple.com/documentation/foundation/url/1779698-startaccessingsecurityscopedreso Makes sense now that I know it :) Cheers
Topic: App & System Services SubTopic: Core OS Tags:
Oct ’21