Post

Replies

Boosts

Views

Activity

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
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 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