Post

Replies

Boosts

Views

Activity

Multiple relationship variables of the the same type
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 } }
0
0
313
Jul ’24
Navigation Link
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
0
0
410
Jul ’22
Multiple relationship variables of the the same type
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 } }
Replies
0
Boosts
0
Views
313
Activity
Jul ’24
Navigation Link
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
Replies
0
Boosts
0
Views
410
Activity
Jul ’22
Push App update to TestFlight
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
Replies
1
Boosts
0
Views
853
Activity
Jul ’22