Hi,
it is possible in SwiftUI to detect in a .drop modifier if the source is the running app, or if the source is another app ? This way (example)
AnyView
.onDrop(of: [.fileURL], isTargeted: $targeted) { provider in
if provider.type == ImageView.type {
// The content comes from the app
} else {
// The content comes from outside
}
}
Post
Replies
Boosts
Views
Activity
Hi,
in order to adopt the new SwiftUI App Lifecycle and update my old UI to the new BigSur I made some changes. I can now move to the trash my old AppDelegate and my app is working almost fine with a great improvement in UI look'n feel.
But I had a NSWindow subclass with some methods for handle NSEvents (as scrollWheel: with event) to perform some tasks in the UI.
It is possible to have the same NSWindow subclass by adopting the new SwiftUI App lifecycle?
Thanks in advance.
Hi,
All the Lists I was developed in my app that was using Sections appears totally broken after update my project to Xcode 12 and macOS Big Sur for macOS apps.
struct ContentView: View {
var body: some View {
List {
Section(header: Text("Important tasks")) {
Text("Helloworld1")
Text("Helloworld2")
}
Section(header: Text("Other tasks")) {
Text("Helloworld3")
Text("Helloworld4")
}
}
}
}
This code works fine on iOS projects, but not in macOS projects. In macOS the section contents doesn't appear neither the preview nor app execution.
Could be a bug or I'm missing something building sectioned lists?
Thanks in advance.