I have a model like so...
struct User: Codable {
let followersCount: Int
let followingCount: Int
}
Using NavigationStack I would like to be able to use NavigationLink based on Value
NavigationLink(value: user.followersCount) {
Text("Followers")
}
NavigationLink(value: user.followingCount) {
Text("Following")
}
.navigationDestination(for: Int.self) { _ in
FollowersView()
}
.navigationDestination(for: Int.self) { _ in
FollowingView()
}
As both values are an Int. Is there a way to differentiate the two?