Im trying to show another view with SwiftUI, when a button is pressed. Here is what I am trying:
import SwiftUI
struct Home: View {
var body: some View {
VStack {
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
Button("Press here!") {
iPhone13About()
}
}
}
}
Where I hover over iPhone13About()
, it says, "Result of 'iPhone13About' initializer is unused". Im a beginner with Xcode, and I am trying to mess around with Xcode and to create something.
The Swift UI View is called iPhone13.swift, and the function it is passing is
struct iPhone13About: View {
Thanks in advance!