Unfortunately that didn't work.
Post
Replies
Boosts
Views
Activity
Your understanding is correct. I believe it's a waste to download unnecessary files and thought there might be a way to prevent it from downloading a part of the hierarchy.
Thanks for the feedback.
Found my answer.
In the target dependencies, need to include the package name as a string:
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "DBCore",
dependencies: [
"AgileDB"
]),
.testTarget(
name: "DBCoreTests",
dependencies: ["DBCore"]),
]
Needed to enable code coverage in the scheme
...
I know how to do it statically. The data shown here was for illustrative purposes. What if I have a form and want to send some user-entered form data? Or the new state of a toggle after the user flips it? If I can't, I can take another approach. I was just wondering if there's a way in my implementation.
Full test project here: https://github.com/AaronBratcher/DragTest
found my issue… it involved an assert with a bool returning func that didn't throw. somehow,, wrapping the method call in assert caused it to not run.
I found a solution that works better for me here: https://stackoverflow.com/questions/77025438/how-do-i-preview-a-view-thats-using-bindable
FamilyMember has hashable extension
Sorry, forgot to include the view code:
import SwiftUI
import CommonUI
import SwiftData
struct ChoreView: View {
@Bindable var chore: Chore
@Environment(\.modelContext) private var context
@Query private var familyMembers: [FamilyMember]
var body: some View {
Card {
Form {
Section("Name") {
TextField("Name", text: $chore.name)
}
Section("Frequency") {
Picker(selection: $chore.choreFrequency, label: EmptyView()) {
ForEach(ChoreFrequency.allCases) { frequency in
Text(frequency.rawValue.localized).tag(frequency.rawValue)
}
}
}
}
.frame(maxHeight: 400)
.padding(-6)
}
}
}
I am an *****. Never mind, I got the property name wrong.
I'm getting a JITError: Runtime linking failure error with the 16.0 release. Only 1 SwiftUI view so far. Use Legacy Previews Execution is working so far.
import SwiftUI
struct Dashboard: View {
var body: some View {
Text("hello")
}
}
#Preview {
Dashboard()
}
Use Legacy Previews Execution is working so far.
The assets will be in whatever project the package is used in. To put the assets into the package itself is not good and, unfortunately, there isn't a Preview Content option with packages.