Want to know if it's possible to have multiple variables of the same type? This code works but when the app loads the data again on relaunch, both variables have both the new cards and discarded cards.
@Model
class Player {
let id = UUID()
let name: String
@Relationship(deleteRule: .cascade, inverse: \Card.player) var cards: [Card] = []
@Relationship(deleteRule: .cascade, inverse: \Card.player) var discardedCards: [Card] = []
init(name: String, cards: [Card]) {
self.name = name
self.cards = cards
}
}
@Model
class Card {
let id = UUID()
let name: String
var player: Player?
init(name: String) {
self.name = name
}
}
Post
Replies
Boosts
Views
Activity
Trying to implement two NavigationLinks that navigate to the same View, but each Link changes a Bool in another class. I can't work out how to access that Bool in the Navigation Link code block.
If anyone has any suggestions as to I complete this would be great. Thanks
First time launching an app on TestFlight, have changed a few things and want to push them to the testers on TestFlight. How do I do it and can it be done straight from Xcode? Cheers