Thank you for the help, it works now!!! :D
Post
Replies
Boosts
Views
Activity
You must be at least 18 years old to have an organizational developer account, and 13 years old to enroll as an individual. If your account is set under 18, try change the age to be older.
could you please share the readme file or the text content, they may have implied it in some way or another
struct ZodiacSign: Identifiable {
let id = UUID()
var name: String
var Symbol: String
var DestinationView: View
}
var starSigns = [
ZodiacSign(name: "Aries", Symbol: "♈︎", DestinationView: AriesView()),
ZodiacSign(name: "Taurus", Symbol: "♉︎", DestinationView: TaurusView()),
ZodiacSign(name: "Gemini", Symbol: "♊︎", DestinationView: GeminiView()),
ZodiacSign(name: "Cancer", Symbol: "♋︎", DestinationView: CancerView()),
ZodiacSign(name: "Leo", Symbol: "♌︎", DestinationView: LeoView()),
ZodiacSign(name: "Virgo", Symbol: "♍︎", DestinationView: VirgoView()),
ZodiacSign(name: "Libra", Symbol: "♎︎", DestinationView: LibraView()),
ZodiacSign(name: "Scorpio", Symbol: "♏︎", DestinationView: ScorpioView()),
ZodiacSign(name: "Sagittarius", Symbol: "♐︎", DestinationView: SagittariusView()),
ZodiacSign(name: "Capricorn", Symbol: "♑︎", DestinationView: CapricornView()),
ZodiacSign(name: "Aquarius", Symbol: "♒︎", DestinationView: AquariusView()),
ZodiacSign(name: "Pisces", Symbol: "♓︎", DestinationView: PiscesView())
]
struct ContentView: View {
var body: some View {
VStack {
List {
ForEach(starSigns) {ZodiacSign in
NavigationLink(destination: ZodiacSign.DestinationView) {
Text(ZodiacSign.Symbol)
Text(ZodiacSign.name)
}
}
}
}
}
}
struct AriesView: View {
var body: some View {
VStack {
}
}
}
struct TaurusView: View {
var body: some View {
VStack {
}
}
}
struct GeminiView: View {
var body: some View {
VStack {
}
}
}
struct CancerView: View {
var body: some View {
VStack {
}
}
}
struct LeoView: View {
var body: some View {
VStack {
}
}
}
struct VirgoView: View {
var body: some View {
VStack {
}
}
}
struct LibraView: View {
var body: some View {
VStack {
}
}
}
struct ScorpioView: View {
var body: some View {
VStack {
}
}
}
struct SagittariusView: View {
var body: some View {
VStack {
}
}
}
struct CapricornView: View {
var body: some View {
VStack {
}
}
}
struct AquariusView: View {
var body: some View {
VStack {
}
}
}
struct PiscesView: View {
var body: some View {
VStack {
}
}
}
This is the full code, line 5 is where I was referring to earlier, I would like to add the destination in each one, please could you explain how I would do this.